summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-03-26 18:53:31 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-03-26 18:53:31 +0100
commiteb0f129fcedcecbee85403095abad8f59b82683c (patch)
tree562179cf65bcdcfe1fc2ea42b401ddce620de350 /lib
parentb1c030b0ba59eed6da5271ed592d6b93ed088518 (diff)
parent48cff379a718998cd984d60fb6f8b48cb961c0f1 (diff)
downloadbird-eb0f129fcedcecbee85403095abad8f59b82683c.tar
bird-eb0f129fcedcecbee85403095abad8f59b82683c.zip
Merge branch 'socket2' into new
Diffstat (limited to 'lib')
-rw-r--r--lib/socket.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/socket.h b/lib/socket.h
index a285799..e6ce125 100644
--- a/lib/socket.h
+++ b/lib/socket.h
@@ -36,8 +36,11 @@ typedef struct birdsock {
void (*err_hook)(struct birdsock *, int); /* errno or zero if EOF */
- ip_addr faddr; /* For packet protocols: source of current packet */
- unsigned fport;
+ /* Information about received datagrams (UDP, RAW), valid in rx_hook */
+ ip_addr faddr, laddr; /* src (From) and dst (Local) address of the datagram */
+ unsigned fport; /* src port of the datagram */
+ unsigned lifindex; /* local interface that received the datagram */
+ /* laddr and lifindex are valid only if SKF_LADDR_RX flag is set to request it */
int fd; /* System-dependent data */
node n;
@@ -77,7 +80,9 @@ sk_send_buffer_empty(sock *sk)
/* Socket flags */
-#define SKF_V6ONLY 1 /* Use IPV6_V6ONLY socket option */
+#define SKF_V6ONLY 1 /* Use IPV6_V6ONLY socket option */
+#define SKF_LADDR_RX 2 /* Report local address for RX packets */
+#define SKF_LADDR_TX 4 /* Allow to specify local address for TX packets */
/*