OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [tcpip/] [current/] [include/] [netinet6/] [ip6_var.h] - Blame information for rev 856

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      include/netinet6_ip6_var.h
4
//
5
//      
6
//
7
//==========================================================================
8
// ####BSDALTCOPYRIGHTBEGIN####                                             
9
// -------------------------------------------                              
10
// Portions of this software may have been derived from OpenBSD             
11
// or other sources, and if so are covered by the appropriate copyright     
12
// and license included herein.                                             
13
// -------------------------------------------                              
14
// ####BSDALTCOPYRIGHTEND####                                               
15
//==========================================================================
16
//#####DESCRIPTIONBEGIN####
17
//
18
// Author(s):    gthomas
19
// Contributors: gthomas
20
// Date:         2000-01-10
21
// Purpose:      
22
// Description:  
23
//              
24
//
25
//####DESCRIPTIONEND####
26
//
27
//==========================================================================
28
 
29
/*      $OpenBSD: ip6_var.h,v 1.2 1999/12/10 10:04:28 angelos Exp $     */
30
 
31
/*
32
 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
33
 * All rights reserved.
34
 *
35
 * Redistribution and use in source and binary forms, with or without
36
 * modification, are permitted provided that the following conditions
37
 * are met:
38
 * 1. Redistributions of source code must retain the above copyright
39
 *    notice, this list of conditions and the following disclaimer.
40
 * 2. Redistributions in binary form must reproduce the above copyright
41
 *    notice, this list of conditions and the following disclaimer in the
42
 *    documentation and/or other materials provided with the distribution.
43
 * 3. Neither the name of the project nor the names of its contributors
44
 *    may be used to endorse or promote products derived from this software
45
 *    without specific prior written permission.
46
 *
47
 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
48
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
50
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
51
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
53
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
55
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
56
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
57
 * SUCH DAMAGE.
58
 */
59
 
60
/*
61
 * Copyright (c) 1982, 1986, 1993
62
 *      The Regents of the University of California.  All rights reserved.
63
 *
64
 * Redistribution and use in source and binary forms, with or without
65
 * modification, are permitted provided that the following conditions
66
 * are met:
67
 * 1. Redistributions of source code must retain the above copyright
68
 *    notice, this list of conditions and the following disclaimer.
69
 * 2. Redistributions in binary form must reproduce the above copyright
70
 *    notice, this list of conditions and the following disclaimer in the
71
 *    documentation and/or other materials provided with the distribution.
72
 * 3. All advertising materials mentioning features or use of this software
73
 *    must display the following acknowledgement:
74
 *      This product includes software developed by the University of
75
 *      California, Berkeley and its contributors.
76
 * 4. Neither the name of the University nor the names of its contributors
77
 *    may be used to endorse or promote products derived from this software
78
 *    without specific prior written permission.
79
 *
80
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
81
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
82
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
83
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
84
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
85
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
86
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
87
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
88
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
89
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
90
 * SUCH DAMAGE.
91
 *
92
 *      @(#)ip_var.h    8.1 (Berkeley) 6/10/93
93
 */
94
 
95
#ifndef _NETINET6_IP6_VAR_H_
96
#define _NETINET6_IP6_VAR_H_
97
 
98
/*
99
 * IP6 reassembly queue structure.  Each fragment
100
 * being reassembled is attached to one of these structures.
101
 */
102
struct  ip6q {
103
        u_long  ip6q_head;
104
        u_short ip6q_len;
105
        u_char  ip6q_nxt;
106
        u_char  ip6q_hlim;
107
        struct  ip6asfrag *ip6q_down;
108
        struct  ip6asfrag *ip6q_up;
109
        u_long  ip6q_ident;
110
        u_char  ip6q_arrive;
111
        u_char  ip6q_ttl;
112
        struct  in6_addr ip6q_src, ip6q_dst;
113
        struct  ip6q *ip6q_next;
114
        struct  ip6q *ip6q_prev;
115
        int     ip6q_unfrglen;
116
#ifdef notyet
117
        u_char  *ip6q_nxtp;
118
#endif
119
};
120
 
121
struct  ip6asfrag {
122
        u_long  ip6af_head;
123
        u_short ip6af_len;
124
        u_char  ip6af_nxt;
125
        u_char  ip6af_hlim;
126
        /* must not override the above members during reassembling */
127
        struct  ip6asfrag *ip6af_down;
128
        struct  ip6asfrag *ip6af_up;
129
        u_short ip6af_mff;
130
        u_short ip6af_off;
131
        struct  mbuf *ip6af_m;
132
        u_long  ip6af_offset;           /* offset where next header starts */
133
        u_short ip6af_frglen;   /* fragmentable part length */
134
        u_char  ip6af_x1[10];
135
};
136
 
137
#define IP6_REASS_MBUF(ip6af) (*(struct mbuf **)&((ip6af)->ip6af_m))
138
 
139
struct  ip6_moptions {
140
        struct  ifnet *im6o_multicast_ifp; /* ifp for outgoing multicasts */
141
        u_char  im6o_multicast_hlim;    /* hoplimit for outgoing multicasts */
142
        u_char  im6o_multicast_loop;    /* 1 >= hear sends if a member */
143
        LIST_HEAD(, in6_multi_mship) im6o_memberships;
144
};
145
 
146
/*
147
 * Control options for outgoing packets
148
 */
149
 
150
/* Routing header related info */
151
struct  ip6po_rhinfo {
152
        struct  ip6_rthdr *ip6po_rhi_rthdr; /* Routing header */
153
        struct  route_in6 ip6po_rhi_route; /* Route to the 1st hop */
154
};
155
#define ip6po_rthdr     ip6po_rhinfo.ip6po_rhi_rthdr
156
#define ip6po_route     ip6po_rhinfo.ip6po_rhi_route
157
 
158
struct  ip6_pktopts {
159
        struct  mbuf *ip6po_m;  /* Pointer to mbuf storing the data */
160
        int     ip6po_hlim;             /* Hoplimit for outgoing packets */
161
        struct  in6_pktinfo *ip6po_pktinfo; /* Outgoing IF/address information */
162
        struct  sockaddr *ip6po_nexthop;        /* Next-hop address */
163
        struct  ip6_hbh *ip6po_hbh; /* Hop-by-Hop options header */
164
        struct  ip6_dest *ip6po_dest1; /* Destination options header(1st part) */
165
        struct  ip6po_rhinfo ip6po_rhinfo; /* Routing header related info. */
166
        struct  ip6_dest *ip6po_dest2; /* Destination options header(2nd part) */
167
};
168
 
169
struct  ip6stat {
170
        u_quad_t ip6s_total;            /* total packets received */
171
        u_quad_t ip6s_tooshort;         /* packet too short */
172
        u_quad_t ip6s_toosmall;         /* not enough data */
173
        u_quad_t ip6s_fragments;        /* fragments received */
174
        u_quad_t ip6s_fragdropped;      /* frags dropped(dups, out of space) */
175
        u_quad_t ip6s_fragtimeout;      /* fragments timed out */
176
        u_quad_t ip6s_fragoverflow;     /* fragments that exceeded limit */
177
        u_quad_t ip6s_forward;          /* packets forwarded */
178
        u_quad_t ip6s_cantforward;      /* packets rcvd for unreachable dest */
179
        u_quad_t ip6s_redirectsent;     /* packets forwarded on same net */
180
        u_quad_t ip6s_delivered;        /* datagrams delivered to upper level*/
181
        u_quad_t ip6s_localout;         /* total ip packets generated here */
182
        u_quad_t ip6s_odropped;         /* lost packets due to nobufs, etc. */
183
        u_quad_t ip6s_reassembled;      /* total packets reassembled ok */
184
        u_quad_t ip6s_fragmented;       /* datagrams sucessfully fragmented */
185
        u_quad_t ip6s_ofragments;       /* output fragments created */
186
        u_quad_t ip6s_cantfrag;         /* don't fragment flag was set, etc. */
187
        u_quad_t ip6s_badoptions;       /* error in option processing */
188
        u_quad_t ip6s_noroute;          /* packets discarded due to no route */
189
        u_quad_t ip6s_badvers;          /* ip6 version != 6 */
190
        u_quad_t ip6s_rawout;           /* total raw ip packets generated */
191
        u_quad_t ip6s_badscope;         /* scope error */
192
        u_quad_t ip6s_notmember;        /* don't join this multicast group */
193
        u_quad_t ip6s_nxthist[256];     /* next header history */
194
        u_quad_t ip6s_m1;               /* one mbuf */
195
        u_quad_t ip6s_m2m[32];          /* two or more mbuf */
196
        u_quad_t ip6s_mext1;            /* one ext mbuf */
197
        u_quad_t ip6s_mext2m;           /* two or more ext mbuf */
198
        u_quad_t ip6s_exthdrtoolong;    /* ext hdr are not continuous */
199
        u_quad_t ip6s_nogif;            /* no match gif found */
200
        u_quad_t ip6s_toomanyhdr;       /* discarded due to too many headers */
201
        /* XXX the following two items are not really AF_INET6 thing */
202
        u_quad_t ip6s_pulldown;         /* # of calls to m_pulldown */
203
        u_quad_t ip6s_pulldown_copy;    /* # of mbuf copies in m_pulldown */
204
        u_quad_t ip6s_pulldown_alloc;   /* # of mbuf allocs in m_pulldown */
205
};
206
 
207
#ifdef _KERNEL
208
/* flags passed to ip6_output as last parameter */
209
#define IPV6_DADOUTPUT          0x01    /* DAD */
210
#define IPV6_FORWARDING         0x02    /* most of IPv6 header exists */
211
 
212
extern struct   ip6stat ip6stat;        /* statistics */
213
extern u_int32_t ip6_id;                /* fragment identifier */
214
extern int      ip6_defhlim;            /* default hop limit */
215
extern int      ip6_defmcasthlim;       /* default multicast hop limit */
216
extern int      ip6_forwarding;         /* act as router? */
217
extern int      ip6_forward_srcrt;      /* forward src-routed? */
218
extern int      ip6_gif_hlim;           /* Hop limit for gif encap packet */
219
extern int      ip6_use_deprecated;     /* allow deprecated addr as source */
220
extern int      ip6_rr_prune;           /* router renumbering prefix
221
                                         * walk list every 5 sec.    */
222
#ifdef MAPPED_ADDR_ENABLED
223
extern int      ip6_mapped_addr_on;
224
#endif /* MAPPED_ADDR_ENABLED */
225
 
226
extern struct socket *ip6_mrouter;      /* multicast routing daemon */
227
extern int      ip6_sendredirects;      /* send IP redirects when forwarding? */
228
extern int      ip6_maxfragpackets; /* Maximum packets in reassembly queue */
229
extern int      ip6_sourcecheck;        /* Verify source interface */
230
extern int      ip6_sourcecheck_interval; /* Interval between log messages */
231
extern int      ip6_accept_rtadv;       /* Acts as a host not a router */
232
extern int      ip6_keepfaith;          /* Firewall Aided Internet Translator */
233
extern int      ip6_log_interval;
234
extern time_t   ip6_log_time;
235
extern int      ip6_hdrnestlimit; /* upper limit of # of extension headers */
236
extern int      ip6_dad_count;          /* DupAddrDetectionTransmits */
237
 
238
extern u_int32_t ip6_flow_seq;
239
extern int ip6_auto_flowlabel;
240
 
241
struct in6pcb;
242
struct inpcb;
243
 
244
int     icmp6_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
245
 
246
void    ip6_init __P((void));
247
void    ip6intr __P((void));
248
void    ip6_input __P((struct mbuf *));
249
void    ip6_freemoptions __P((struct ip6_moptions *));
250
int     ip6_unknown_opt __P((u_int8_t *, struct mbuf *, int));
251
char *  ip6_get_prevhdr __P((struct mbuf *, int));
252
int     ip6_mforward __P((struct ip6_hdr *, struct ifnet *, struct mbuf *));
253
int     ip6_process_hopopts __P((struct mbuf *, u_int8_t *, int, u_int32_t *,
254
                                 u_int32_t *));
255
void    ip6_savecontrol __P((struct inpcb *, struct mbuf **, struct ip6_hdr *,
256
                struct mbuf *));
257
int     ip6_sysctl __P((int *, u_int, void *, size_t *, void *, size_t));
258
 
259
void    ip6_forward __P((struct mbuf *, int));
260
 
261
void    ip6_mloopback __P((struct ifnet *, struct mbuf *, struct sockaddr_in6 *));
262
int     ip6_output __P((struct mbuf *, struct ip6_pktopts *,
263
                        struct route_in6 *, int,
264
                        struct ip6_moptions *, struct ifnet **));
265
int     ip6_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
266
int     ip6_setpktoptions __P((struct mbuf *, struct ip6_pktopts *, int));
267
int     ip6_optlen __P((struct inpcb *));
268
 
269
int     route6_input __P((struct mbuf **, int *, int));
270
 
271
void    frag6_init __P((void));
272
int     frag6_input __P((struct mbuf **, int *, int));
273
void    frag6_slowtimo __P((void));
274
void    frag6_drain __P((void));
275
 
276
void    rip6_init __P((void));
277
int     rip6_input __P((struct mbuf **mp, int *offp, int proto));
278
int     rip6_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
279
int     rip6_output __P((struct mbuf *, ...));
280
int     rip6_usrreq __P((struct socket *,
281
            int, struct mbuf *, struct mbuf *, struct mbuf *, struct proc *));
282
 
283
int     dest6_input __P((struct mbuf **, int *, int));
284
int     none_input __P((struct mbuf **, int *, int));
285
#endif /* _KERNEL */
286
 
287
#endif /* !_NETINET6_IP6_VAR_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.