diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-04-16 05:23:12 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-04-16 05:23:12 +0200 |
commit | 96ec41768b5937e5cf0cd83bf815d365d12d1f93 (patch) | |
tree | c56fb1c45db75c32b156b5ceee8758334df69c12 /src/peer.h | |
parent | 037c58ae51a61064d7bb5022715546509328d83f (diff) | |
download | fastd-96ec41768b5937e5cf0cd83bf815d365d12d1f93.tar fastd-96ec41768b5937e5cf0cd83bf815d365d12d1f93.zip |
Add support for peers specified by hostnames
Diffstat (limited to 'src/peer.h')
-rw-r--r-- | src/peer.h | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -30,12 +30,6 @@ #include "fastd.h" -union _fastd_peer_address { - struct sockaddr sa; - struct sockaddr_in in; - struct sockaddr_in6 in6; -}; - struct _fastd_peer { fastd_peer *next; @@ -59,6 +53,7 @@ struct _fastd_peer_config { bool enabled; char *name; + char *hostname; fastd_peer_address address; char *key; @@ -89,7 +84,7 @@ const fastd_eth_addr* fastd_get_source_address(const fastd_context *ctx, fastd_b const fastd_eth_addr* fastd_get_dest_address(const fastd_context *ctx, fastd_buffer buffer); static inline bool fastd_peer_config_is_floating(const fastd_peer_config *config) { - return (config->address.sa.sa_family == AF_UNSPEC); + return (config->hostname == NULL && config->address.sa.sa_family == AF_UNSPEC); } static inline bool fastd_peer_is_floating(const fastd_peer *peer) { |