summaryrefslogtreecommitdiffstats
path: root/src/if.h
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-01-15 14:28:24 +0000
committerRoy Marples <roy@marples.name>2020-01-15 14:28:24 +0000
commit4dcd539c2259273ae89a364069378ca7327cd428 (patch)
tree8bbadd0bf18d911402270bffeec30288a1635129 /src/if.h
parentdbf19b104503e4dea1616e03fa472f60d2cdfd4e (diff)
downloaddhcpcd-4dcd539c2259273ae89a364069378ca7327cd428.tar.xz
Implement Anonymity Profiles for DHCP Clients, RFC 7844
This works by randomising the hardware address when carrier is down and using this to construct a DUID LL which is used over any saved DUID. IAID is defaulted to zero and hostname + FQDN are disabled. Then every possible option is masked out except for essential ones. It's possible to request options *after* anonymous option which will enable it. This is RFC compliant and allows 100% flexability in letting the user decide what, if any, details leek out. This is disabled by default. Only works on NetBSD, other OS coming shortly.
Diffstat (limited to 'src/if.h')
-rw-r--r--src/if.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/if.h b/src/if.h
index e371e970..2f147f1d 100644
--- a/src/if.h
+++ b/src/if.h
@@ -121,9 +121,10 @@ int if_getsubnet(struct dhcpcd_ctx *, const char *, int, void *, size_t);
#endif
int if_ioctl(struct dhcpcd_ctx *, ioctl_request_t, void *, size_t);
-int if_getflags(struct interface *ifp);
-int if_setflag(struct interface *ifp, short flag);
-#define if_up(ifp) if_setflag((ifp), (IFF_UP | IFF_RUNNING))
+int if_getflags(struct interface *);
+int if_setflag(struct interface *, short, short);
+#define if_up(ifp) if_setflag((ifp), (IFF_UP | IFF_RUNNING), 0)
+#define if_down(ifp) if_setflag((ifp), 0, IFF_UP);
bool if_valid_hwaddr(const uint8_t *, size_t);
struct if_head *if_discover(struct dhcpcd_ctx *, struct ifaddrs **,
int, char * const *);
@@ -171,6 +172,8 @@ int if_opensockets_os(struct dhcpcd_ctx *);
void if_closesockets(struct dhcpcd_ctx *);
void if_closesockets_os(struct dhcpcd_ctx *);
int if_handlelink(struct dhcpcd_ctx *);
+int if_randomisemac(struct interface *);
+int if_setmac(struct interface *ifp, void *, uint8_t);
/* dhcpcd uses the same routing flags as BSD.
* If the platform doesn't use these flags,