summaryrefslogtreecommitdiffstats
path: root/src/peer.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-06 21:29:34 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-06 21:29:34 +0100
commit1d18f972554c8bad0f08b3ff6727c87586e97094 (patch)
treeae3fc39553ecd87ed85b22860640d2859e9aa092 /src/peer.h
parentd4686dd79799c09faee49e1645f9b3c39ce1e993 (diff)
downloadfastd-1d18f972554c8bad0f08b3ff6727c87586e97094.tar
fastd-1d18f972554c8bad0f08b3ff6727c87586e97094.zip
Reorganized type definitions
Diffstat (limited to 'src/peer.h')
-rw-r--r--src/peer.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/peer.h b/src/peer.h
index 46cdca9..64cb912 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -31,6 +31,39 @@
#include "fastd.h"
+union _fastd_peer_address {
+ struct sockaddr sa;
+ struct sockaddr_in in;
+ struct sockaddr_in6 in6;
+};
+
+struct _fastd_peer {
+ fastd_peer *next;
+
+ const fastd_peer_config *config;
+
+ fastd_peer_address address;
+
+ fastd_peer_state state;
+ uint8_t last_req_id;
+};
+
+struct _fastd_peer_config {
+ fastd_peer_config *next;
+
+ fastd_peer_address address;
+};
+
+struct _fastd_eth_addr {
+ uint8_t data[ETH_ALEN];
+};
+
+struct _fastd_peer_eth_addr {
+ fastd_eth_addr addr;
+ fastd_peer *peer;
+};
+
+
const fastd_eth_addr* fastd_get_source_address(const fastd_context *ctx, fastd_buffer buffer);
const fastd_eth_addr* fastd_get_dest_address(const fastd_context *ctx, fastd_buffer buffer);