diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-05-27 22:33:41 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-05-27 22:33:41 +0200 |
commit | adb7453fae67c777974e1d4c1a5f80f2378c61c3 (patch) | |
tree | 8fe97aa750de693c2b6d4d7ae2303fd27764375a /src/fastd.h | |
parent | 073357bec4e65da17a30411798476e4abc81bf9d (diff) | |
download | fastd-adb7453fae67c777974e1d4c1a5f80f2378c61c3.tar fastd-adb7453fae67c777974e1d4c1a5f80f2378c61c3.zip |
Merge handle_forward into fastd_send_data
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/fastd.h b/src/fastd.h index 8a11a41..8e57338 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -301,8 +301,7 @@ extern fastd_config_t conf; /**< The global configuration */ void fastd_send(const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_peer_t *peer, fastd_buffer_t buffer, size_t stat_size); void fastd_send_handshake(const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_peer_t *peer, fastd_buffer_t buffer); -void fastd_send_all(fastd_peer_t *source_peer, fastd_buffer_t buffer); -void fastd_send_data(fastd_buffer_t buffer); +void fastd_send_data(fastd_buffer_t buffer, fastd_peer_t *source); void fastd_receive(fastd_socket_t *sock); void fastd_handle_receive(fastd_peer_t *peer, fastd_buffer_t buffer); @@ -390,31 +389,6 @@ static inline size_t fastd_max_inner_packet(void) { } } -/** Returns the source address of an ethernet packet */ -static inline fastd_eth_addr_t fastd_get_source_address(const fastd_buffer_t buffer) { - fastd_eth_addr_t ret; - - switch (conf.mode) { - case MODE_TAP: - memcpy(&ret, buffer.data+offsetof(struct ethhdr, h_source), ETH_ALEN); - return ret; - default: - exit_bug("invalid mode"); - } -} - -/** Returns the destination address of an ethernet packet */ -static inline fastd_eth_addr_t fastd_get_dest_address(const fastd_buffer_t buffer) { - fastd_eth_addr_t ret; - switch (conf.mode) { - case MODE_TAP: - memcpy(&ret, buffer.data+offsetof(struct ethhdr, h_dest), ETH_ALEN); - return ret; - default: - exit_bug("invalid mode"); - } -} - /** Returns the packet size (payload + overhead) \em fastd is configured to transport */ static inline size_t fastd_max_outer_packet(void) { return 1 + fastd_max_inner_packet() + conf.max_overhead; |