diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-02-29 22:44:40 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-02-29 22:44:40 +0100 |
commit | 0f2e170ea6edee4df0f90a3821d5c054db6bd6b7 (patch) | |
tree | 6d90aea5c094eec471e6aa2f25f9f080741d1320 /src/fastd.h | |
parent | b5892c34186707a50b2afb713e13cbfc3e859920 (diff) | |
download | fastd-0f2e170ea6edee4df0f90a3821d5c054db6bd6b7.tar fastd-0f2e170ea6edee4df0f90a3821d5c054db6bd6b7.zip |
Only send packets to the right host in ethernet mode
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/fastd.h b/src/fastd.h index 90df868..acc5a19 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -73,6 +73,10 @@ typedef enum _fastd_peer_state { STATE_ESTABLISHED, } fastd_peer_state; +typedef struct _fastd_eth_addr { + uint8_t data[ETH_ALEN]; +} fastd_eth_addr; + typedef struct _fastd_peer { struct _fastd_peer *next; @@ -83,10 +87,13 @@ typedef struct _fastd_peer { fastd_peer_state state; uint8_t last_req_id; - - void **addresses; } fastd_peer; +typedef struct _fastd_peer_eth_addr { + fastd_eth_addr addr; + fastd_peer *peer; +} fastd_peer_eth_addr; + typedef struct _fastd_context fastd_context; typedef struct _fastd_method { @@ -124,6 +131,10 @@ struct _fastd_context { int tunfd; int sockfd; + + size_t eth_addr_size; + size_t n_eth_addr; + fastd_peer_eth_addr *eth_addr; }; @@ -152,7 +163,6 @@ static inline void fastd_buffer_free(fastd_buffer buffer) { free(buffer.base); } - static inline size_t fastd_max_packet_size(const fastd_context *ctx) { switch (ctx->conf->protocol) { case PROTOCOL_ETHERNET: |