summaryrefslogtreecommitdiffstats
path: root/sys/net/if.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if.h')
-rw-r--r--sys/net/if.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/net/if.h b/sys/net/if.h
index 8ceea66..350e6d8 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -152,6 +152,7 @@ struct ifma_msghdr {
*/
struct ifreq {
#define IFNAMSIZ 16
+#define IF_NAMESIZE IFNAMSIZ
char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
union {
struct sockaddr ifru_addr;
@@ -227,6 +228,19 @@ struct ifconf {
#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
};
+
+/*
+ * Structure for SIOC[AGD]LIFADDR
+ */
+struct if_laddrreq {
+ char iflr_name[IFNAMSIZ];
+ u_int flags;
+#define IFLR_PREFIX 0x8000 /* in: prefix given out: kernel fills id */
+ u_int prefixlen; /* in/out */
+ struct sockaddr_storage addr; /* in/out */
+ struct sockaddr_storage dstaddr; /* out */
+};
+
#ifdef KERNEL
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_IFADDR);
@@ -234,6 +248,20 @@ MALLOC_DECLARE(M_IFMADDR);
#endif
#endif
+#ifndef KERNEL
+struct if_nameindex {
+ u_int if_index; /* 1, 2, ... */
+ char *if_name; /* null terminated name: "le0", ... */
+};
+
+__BEGIN_DECLS
+u_int if_nametoindex __P((const char *));
+char *if_indextoname __P((u_int, char *));
+struct if_nameindex *if_nameindex __P((void));
+void if_freenameindex __P((struct if_nameindex *));
+__END_DECLS
+#endif
+
#ifdef KERNEL
struct proc;
OpenPOWER on IntegriCloud