diff options
author | shin <shin@FreeBSD.org> | 1999-11-05 14:41:39 +0000 |
---|---|---|
committer | shin <shin@FreeBSD.org> | 1999-11-05 14:41:39 +0000 |
commit | 7efc91cadcfeb421fc4d02ba94db784616f3714c (patch) | |
tree | f40f3ca5e5c27dfec6f4c10b00aa3b391491a550 /sys/net | |
parent | 660a7daead2ffcf4f7e3d2a3c874a82ccc8954c8 (diff) | |
download | FreeBSD-src-7efc91cadcfeb421fc4d02ba94db784616f3714c.zip FreeBSD-src-7efc91cadcfeb421fc4d02ba94db784616f3714c.tar.gz |
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
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/ethernet.h | 7 | ||||
-rw-r--r-- | sys/net/if.h | 28 | ||||
-rw-r--r-- | sys/net/if_types.h | 2 | ||||
-rw-r--r-- | sys/net/if_var.h | 18 | ||||
-rw-r--r-- | sys/net/netisr.h | 5 | ||||
-rw-r--r-- | sys/net/route.h | 6 |
6 files changed, 59 insertions, 7 deletions
diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index c8b62e0..8e982d7 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -62,9 +62,10 @@ struct ether_addr { #define ETHERTYPE_PUP 0x0200 /* PUP protocol */ #define ETHERTYPE_IP 0x0800 /* IP protocol */ -#define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */ -#define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */ -#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */ +#define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */ +#define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */ +#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */ +#define ETHERTYPE_IPV6 0x86dd /* IPv6 */ #define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */ /* XXX - add more useful types here */ 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; diff --git a/sys/net/if_types.h b/sys/net/if_types.h index ebcbcbf..318b356 100644 --- a/sys/net/if_types.h +++ b/sys/net/if_types.h @@ -97,5 +97,7 @@ #define IFT_SMDSICIP 0x34 /* SMDS InterCarrier Interface */ #define IFT_PROPVIRTUAL 0x35 /* Proprietary Virtual/internal */ #define IFT_PROPMUX 0x36 /* Proprietary Multiplexing */ +#define IFT_GIF 0x37 +#define IFT_FAITH 0x38 #endif diff --git a/sys/net/if_var.h b/sys/net/if_var.h index a598d19..0b6e40d 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -77,6 +77,7 @@ struct ether_header; TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */ TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */ +TAILQ_HEAD(ifprefixhead, ifprefix); LIST_HEAD(ifmultihead, ifmultiaddr); /* @@ -138,6 +139,7 @@ struct ifnet { __P((struct ifnet *, struct sockaddr **, struct sockaddr *)); struct ifqueue if_snd; /* output queue */ struct ifqueue *if_poll_slowq; /* input queue for slow devices */ + struct ifprefixhead if_prefixhead; /* list of prefixes per if */ }; typedef void if_init_f_t __P((void *)); @@ -269,6 +271,20 @@ struct ifaddr { #define IFA_ROUTE RTF_UP /* route installed */ /* + * The prefix structure contains information about one prefix + * of an interface. They are maintained by the different address families, + * are allocated and attached when an prefix or an address is set, + * and are linked together so all prfefixes for an interface can be located. + */ +struct ifprefix { + struct sockaddr *ifpr_prefix; /* prefix of interface */ + struct ifnet *ifpr_ifp; /* back-pointer to interface */ + TAILQ_ENTRY(ifprefix) *ifpr_list; /* queue macro glue */ + u_char ifpr_plen; /* prefix length in bits */ + u_char ifpr_type; /* protocol dependent prefix type */ +}; + +/* * Multicast address structure. This is analogous to the ifaddr * structure except that it keeps track of multicast addresses. * Also, the reference count here is a count of requests for this @@ -293,6 +309,7 @@ struct ifmultiaddr { } while (0) extern struct ifnethead ifnet; +extern struct ifnet **ifindex2ifnet; extern int ifqmaxlen; extern struct ifnet loif[]; extern int if_index; @@ -318,6 +335,7 @@ void if_up __P((struct ifnet *)); int ifioctl __P((struct socket *, u_long, caddr_t, struct proc *)); int ifpromisc __P((struct ifnet *, int)); struct ifnet *ifunit __P((char *)); +struct ifnet *if_withname __P((struct sockaddr *)); int if_poll_recv_slow __P((struct ifnet *ifp, int *quotap)); void if_poll_xmit_slow __P((struct ifnet *ifp, int *quotap)); diff --git a/sys/net/netisr.h b/sys/net/netisr.h index d09f31d..432607c 100644 --- a/sys/net/netisr.h +++ b/sys/net/netisr.h @@ -61,11 +61,12 @@ #define NETISR_NS 6 /* same as AF_NS */ #define NETISR_ISO 7 /* same as AF_ISO */ #define NETISR_CCITT 10 /* same as AF_CCITT */ -#define NETISR_ATALK 16 /* same as AF_APPLETALK */ +#define NETISR_ATALK 16 /* same as AF_APPLETALK */ #define NETISR_ARP 18 /* same as AF_LINK */ -#define NETISR_IPX 23 /* same as AF_IPX */ +#define NETISR_IPX 23 /* same as AF_IPX */ #define NETISR_ISDN 26 /* same as AF_E164 */ #define NETISR_PPP 27 /* PPP soft interrupt */ +#define NETISR_IPV6 28 /* same as AF_INET6 */ #define NETISR_NATM 29 /* same as AF_NATM */ #define NETISR_NETGRAPH 31 /* same as AF_NETGRAPH */ diff --git a/sys/net/route.h b/sys/net/route.h index 48f0d9a..ba1bb95 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -252,6 +252,7 @@ struct rt_addrinfo { struct route_cb { int ip_count; + int ip6_count; int ipx_count; int ns_count; int iso_count; @@ -281,9 +282,10 @@ void rt_newmaddrmsg __P((int, struct ifmultiaddr *)); int rt_setgate __P((struct rtentry *, struct sockaddr *, struct sockaddr *)); void rtalloc __P((struct route *)); -void rtalloc_ign __P((struct route *, unsigned long)); +void rtalloc_ign __P((struct route *, u_long)); +void rtcalloc __P((struct route *)); /* for INET6 */ struct rtentry * - rtalloc1 __P((struct sockaddr *, int, unsigned long)); + rtalloc1 __P((struct sockaddr *, int, u_long)); void rtfree __P((struct rtentry *)); int rtinit __P((struct ifaddr *, int, int)); int rtioctl __P((int, caddr_t, struct proc *)); |