diff options
| author | Roy Marples <roy@marples.name> | 2008-07-16 22:23:07 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-07-16 22:23:07 +0000 |
| commit | a26af49123674044a0216fbae83bec30db5f8ab3 (patch) | |
| tree | 5024ea32e0cdc998220c80a17d3d3afba0e86ef0 /net.h | |
| parent | c4d4ee1358061ff620679a51b0d620ce4fa1326b (diff) | |
| download | dhcpcd-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.h | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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 |
