From 7efc91cadcfeb421fc4d02ba94db784616f3714c Mon Sep 17 00:00:00 2001 From: shin Date: Fri, 5 Nov 1999 14:41:39 +0000 Subject: KAME related header files additions and merges. (only those which don't affect c source files so much) Reviewed by: cvs-committers Obtained from: KAME project --- sys/net/if.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'sys/net/if.h') 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; -- cgit v1.1