ip6_var.h

来自「eCos操作系统源码」· C头文件 代码 · 共 480 行 · 第 1/2 页

H
480
字号
//==========================================================================////      include/netinet6/ip6_var.h////==========================================================================//####BSDCOPYRIGHTBEGIN####//// -------------------------------------------//// Portions of this software may have been derived from OpenBSD, // FreeBSD or other sources, and are covered by the appropriate// copyright disclaimers included herein.//// Portions created by Red Hat are// Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.//// -------------------------------------------////####BSDCOPYRIGHTEND####//==========================================================================/*	$KAME: ip6_var.h,v 1.79 2001/12/27 15:37:41 jinmei Exp $	*//* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. *//* * Copyright (c) 1982, 1986, 1993 *	The Regents of the University of California.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *	This product includes software developed by the University of *	California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *	@(#)ip_var.h	8.1 (Berkeley) 6/10/93 */#ifndef _NETINET6_IP6_VAR_H_#define _NETINET6_IP6_VAR_H_/* * IP6 reassembly queue structure.  Each fragment * being reassembled is attached to one of these structures. */struct	ip6q {	u_int32_t	ip6q_head;	u_int16_t	ip6q_len;	u_int8_t	ip6q_nxt;	/* ip6f_nxt in first fragment */	u_int8_t	ip6q_hlim;	struct ip6asfrag *ip6q_down;	struct ip6asfrag *ip6q_up;	u_int32_t	ip6q_ident;	u_int8_t	ip6q_arrive;	u_int8_t	ip6q_ttl;	struct in6_addr	ip6q_src, ip6q_dst;	struct ip6q	*ip6q_next;	struct ip6q	*ip6q_prev;	int		ip6q_unfrglen;	/* len of unfragmentable part */#ifdef notyet	u_char		*ip6q_nxtp;#endif};struct	ip6asfrag {	u_int32_t	ip6af_head;	u_int16_t	ip6af_len;	u_int8_t	ip6af_nxt;	u_int8_t	ip6af_hlim;	/* must not override the above members during reassembling */	struct ip6asfrag *ip6af_down;	struct ip6asfrag *ip6af_up;	struct mbuf	*ip6af_m;	int		ip6af_offset;	/* offset in ip6af_m to next header */	int		ip6af_frglen;	/* fragmentable part length */	int		ip6af_off;	/* fragment offset */	u_int16_t	ip6af_mff;	/* more fragment bit in frag off */};#define IP6_REASS_MBUF(ip6af) (*(struct mbuf **)&((ip6af)->ip6af_m))struct	ip6_moptions {	struct	ifnet *im6o_multicast_ifp; /* ifp for outgoing multicasts */	u_char	im6o_multicast_hlim;	/* hoplimit for outgoing multicasts */	u_char	im6o_multicast_loop;	/* 1 >= hear sends if a member */	LIST_HEAD(, in6_multi_mship) im6o_memberships;};/* * Control options for outgoing packets *//* Routing header related info */struct	ip6po_rhinfo {	struct	ip6_rthdr *ip6po_rhi_rthdr; /* Routing header */#if defined(NEW_STRUCT_ROUTE) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)	struct	route ip6po_rhi_route; /* Route to the 1st hop */#else	struct	route_in6 ip6po_rhi_route; /* Route to the 1st hop */#endif};#define ip6po_rthdr	ip6po_rhinfo.ip6po_rhi_rthdr#define ip6po_route	ip6po_rhinfo.ip6po_rhi_route/* Nexthop related info */struct	ip6po_nhinfo {	struct	sockaddr *ip6po_nhi_nexthop;#if defined(NEW_STRUCT_ROUTE) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)	struct	route ip6po_nhi_route; /* Route to the nexthop */#else	struct	route_in6 ip6po_nhi_route; /* Route to the nexthop */#endif};#define ip6po_nexthop	ip6po_nhinfo.ip6po_nhi_nexthop#define ip6po_nextroute	ip6po_nhinfo.ip6po_nhi_routestruct	ip6_pktopts {	int	ip6po_hlim;	/* Hoplimit for outgoing packets */	/* Outgoing IF/address information */	struct	in6_pktinfo *ip6po_pktinfo;	/* Next-hop address information */	struct	ip6po_nhinfo ip6po_nhinfo;		struct	ip6_hbh *ip6po_hbh; /* Hop-by-Hop options header */	/* Destination options header (before a routing header) */	struct	ip6_dest *ip6po_dest1;	/* Routing header related info. */	struct	ip6po_rhinfo ip6po_rhinfo;	/* Destination options header (after a routing header) */	struct	ip6_dest *ip6po_dest2;	/* traffic class */	int		ip6po_tclass;	int ip6po_flags;#define IP6PO_REACHCONF	0x01	/* upper-layer reachability confirmation */#define IP6PO_MINMTU	0x02	/* use minimum MTU (IPV6_USE_MIN_MTU) */#define IP6PO_DONTFRAG	0x04	/* disable fragmentation (IPV6_DONTFRAG) */	int	needfree;	/* members dynamically allocated */};/* * Control options for incoming packets */struct ip6_recvpktopts {	struct mbuf *head;	/* mbuf chain of data passed to a user */#ifdef SO_TIMESTAMP	struct mbuf *timestamp;	/* timestamp */#endif	struct mbuf *hlim;	/* received hop limit */	struct mbuf *pktinfo;	/* packet information of rcv packet */	struct mbuf *hbh;	/* HbH options header of rcv packet */	struct mbuf *dest;	/* Dest opt header of rcv packet */	struct mbuf *rthdr;	/* Routing header of rcv packet */};struct	ip6stat {	u_quad_t ip6s_total;		/* total packets received */	u_quad_t ip6s_tooshort;		/* packet too short */	u_quad_t ip6s_toosmall;		/* not enough data */	u_quad_t ip6s_fragments;	/* fragments received */	u_quad_t ip6s_fragdropped;	/* frags dropped(dups, out of space) */	u_quad_t ip6s_fragtimeout;	/* fragments timed out */	u_quad_t ip6s_fragoverflow;	/* fragments that exceeded limit */	u_quad_t ip6s_forward;		/* packets forwarded */	u_quad_t ip6s_cantforward;	/* packets rcvd for unreachable dest */	u_quad_t ip6s_redirectsent;	/* packets forwarded on same net */	u_quad_t ip6s_delivered;	/* datagrams delivered to upper level*/	u_quad_t ip6s_localout;		/* total ip packets generated here */	u_quad_t ip6s_odropped;		/* lost packets due to nobufs, etc. */	u_quad_t ip6s_reassembled;	/* total packets reassembled ok */	u_quad_t ip6s_fragmented;	/* datagrams sucessfully fragmented */	u_quad_t ip6s_ofragments;	/* output fragments created */	u_quad_t ip6s_cantfrag;		/* don't fragment flag was set, etc. */	u_quad_t ip6s_badoptions;	/* error in option processing */	u_quad_t ip6s_noroute;		/* packets discarded due to no route */	u_quad_t ip6s_badvers;		/* ip6 version != 6 */	u_quad_t ip6s_rawout;		/* total raw ip packets generated */	u_quad_t ip6s_badscope;		/* scope error */	u_quad_t ip6s_notmember;	/* don't join this multicast group */	u_quad_t ip6s_nxthist[256];	/* next header history */	u_quad_t ip6s_m1;		/* one mbuf */	u_quad_t ip6s_m2m[32];		/* two or more mbuf */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?