summaryrefslogtreecommitdiffstats
path: root/net.h
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-07-16 22:23:07 +0000
committerRoy Marples <roy@marples.name>2008-07-16 22:23:07 +0000
commita26af49123674044a0216fbae83bec30db5f8ab3 (patch)
tree5024ea32e0cdc998220c80a17d3d3afba0e86ef0 /net.h
parentc4d4ee1358061ff620679a51b0d620ce4fa1326b (diff)
downloaddhcpcd-a26af49123674044a0216fbae83bec30db5f8ab3.tar.xz
Add support for link carrier detection. For Linux this involved a big change to the netlink code to add callbacks, for BSD just an extra function. We also have an option not to wait for a DHCP lease and fork right away - useful for startup scripts.
Diffstat (limited to 'net.h')
-rw-r--r--net.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/net.h b/net.h
index 12f13211..f2b3dbe1 100644
--- a/net.h
+++ b/net.h
@@ -71,8 +71,8 @@
#endif
#define LINKLOCAL_ADDR 0xa9fe0000
-#define LINKLOCAL_MASK 0xffff0000
-#define LINKLOCAL_BRDC 0xa9feffff
+#define LINKLOCAL_MASK IN_CLASSB_NET
+#define LINKLOCAL_BRDC (LINKLOCAL_ADDR | ~LINKLOCAL_MASK)
#ifndef IN_LINKLOCAL
# define IN_LINKLOCAL(addr) ((addr & IN_CLASSB_NET) == LINKLOCAL_ADDR)
@@ -103,11 +103,12 @@ struct interface
int raw_fd;
int udp_fd;
- size_t buffer_size, buffer_len, buffer_pos;
- unsigned char *buffer;
#ifdef ENABLE_ARP
int arp_fd;
#endif
+ int link_fd;
+ size_t buffer_size, buffer_len, buffer_pos;
+ unsigned char *buffer;
struct in_addr addr;
struct in_addr net;
@@ -172,4 +173,8 @@ ssize_t get_raw_packet(struct interface *, int, void *, ssize_t);
#ifdef ENABLE_ARP
int send_arp(const struct interface *, int, in_addr_t, in_addr_t);
#endif
+
+int open_link_socket(struct interface *);
+int link_changed(struct interface *);
+int carrier_status(const char *);
#endif