00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
#ifndef _NETINET6_IP6_VAR_H_
00073
#define _NETINET6_IP6_VAR_H_
00074
00075
#ifndef __SYS_QUEUE_H
00076
#include <sys/queue.h>
00077
#endif
00078
00079
#ifndef __SYS_MBUF_H
00080
#include <sys/mbuf.h>
00081
#endif
00082
00083
#if !defined(__BORLANDC__)
00084
00085
00086
00087
00088
struct ip6q {
00089 u_int32_t ip6q_head;
00090 u_int16_t ip6q_len;
00091 u_int8_t ip6q_nxt;
00092 u_int8_t ip6q_hlim;
00093
struct ip6asfrag *ip6q_down;
00094
struct ip6asfrag *ip6q_up;
00095 u_int32_t ip6q_ident;
00096 u_int8_t ip6q_arrive;
00097 u_int8_t ip6q_ttl;
00098
struct in6_addr ip6q_src, ip6q_dst;
00099
struct ip6q *ip6q_next;
00100
struct ip6q *ip6q_prev;
00101
int ip6q_unfrglen;
00102
#ifdef notyet
00103
u_char *ip6q_nxtp;
00104
#endif
00105
};
00106
00107
struct ip6asfrag {
00108 u_int32_t ip6af_head;
00109 u_int16_t ip6af_len;
00110 u_int8_t ip6af_nxt;
00111 u_int8_t ip6af_hlim;
00112
00113
struct ip6asfrag *ip6af_down;
00114
struct ip6asfrag *ip6af_up;
00115
struct mbuf *ip6af_m;
00116
int ip6af_offset;
00117
int ip6af_frglen;
00118
int ip6af_off;
00119 u_int16_t ip6af_mff;
00120 };
00121
00122
#define IP6_REASS_MBUF(ip6af) (*(struct mbuf **)&((ip6af)->ip6af_m))
00123
00124
struct ip6_moptions {
00125
struct ifnet *im6o_multicast_ifp;
00126 u_char im6o_multicast_hlim;
00127 u_char im6o_multicast_loop;
00128 LIST_HEAD(dummy, in6_multi_mship) im6o_memberships;
00129 };
00130 #endif
00131
00132 #ifndef _NETINET6_IN6_H_
00133 struct route_in6 {
00134
struct rtentry *ro_rt;
00135
struct sockaddr_in6 ro_dst;
00136 };
00137
#endif
00138
00139
00140
00141
00142
00143
00144
#if !defined(__BORLANDC__)
00145
struct ip6po_rhinfo {
00146
struct ip6_rthdr *ip6po_rhi_rthdr;
00147
struct route_in6 ip6po_rhi_route;
00148 };
00149
#define ip6po_rthdr ip6po_rhinfo.ip6po_rhi_rthdr
00150
#define ip6po_route ip6po_rhinfo.ip6po_rhi_route
00151
00152
struct ip6_pktopts {
00153
struct mbuf *ip6po_m;
00154
int ip6po_hlim;
00155
00156
00157
struct in6_pktinfo *ip6po_pktinfo;
00158
00159
struct sockaddr *ip6po_nexthop;
00160
00161
struct ip6_hbh *ip6po_hbh;
00162
00163
00164
struct ip6_dest *ip6po_dest1;
00165
00166
00167
struct ip6po_rhinfo ip6po_rhinfo;
00168
00169
00170
struct ip6_dest *ip6po_dest2;
00171 };
00172
#endif
00173
00174
00175
00176
00177
00178
struct ip6stat {
00179 u_quad_t ip6s_total;
00180 u_quad_t ip6s_tooshort;
00181 u_quad_t ip6s_toosmall;
00182 u_quad_t ip6s_fragments;
00183 u_quad_t ip6s_fragdropped;
00184 u_quad_t ip6s_fragtimeout;
00185 u_quad_t ip6s_fragoverflow;
00186 u_quad_t ip6s_forward;
00187 u_quad_t ip6s_cantforward;
00188 u_quad_t ip6s_redirectsent;
00189 u_quad_t ip6s_delivered;
00190 u_quad_t ip6s_localout;
00191 u_quad_t ip6s_odropped;
00192 u_quad_t ip6s_reassembled;
00193 u_quad_t ip6s_fragmented;
00194 u_quad_t ip6s_ofragments;
00195 u_quad_t ip6s_cantfrag;
00196 u_quad_t ip6s_badoptions;
00197 u_quad_t ip6s_noroute;
00198 u_quad_t ip6s_badvers;
00199 u_quad_t ip6s_rawout;
00200 u_quad_t ip6s_badscope;
00201 u_quad_t ip6s_notmember;
00202 u_quad_t ip6s_nxthist[256];
00203 u_quad_t ip6s_m1;
00204 u_quad_t ip6s_m2m[32];
00205 u_quad_t ip6s_mext1;
00206 u_quad_t ip6s_mext2m;
00207 u_quad_t ip6s_exthdrtoolong;
00208 u_quad_t ip6s_nogif;
00209 u_quad_t ip6s_toomanyhdr;
00210
00211
00212
00213
00214
00215
00216
00217 u_quad_t ip6s_sources_none;
00218
00219 u_quad_t ip6s_sources_sameif[16];
00220
00221 u_quad_t ip6s_sources_otherif[16];
00222
00223
00224
00225
00226 u_quad_t ip6s_sources_samescope[16];
00227
00228
00229
00230
00231 u_quad_t ip6s_sources_otherscope[16];
00232
00233 u_quad_t ip6s_sources_deprecated[16];
00234
00235 u_quad_t ip6s_forward_cachehit;
00236 u_quad_t ip6s_forward_cachemiss;
00237 };
00238
00239
#ifdef _KERNEL
00240
00241
00242
00243
00244
00245
struct ip6aux {
00246 u_int32_t ip6a_flags;
00247
#define IP6A_SWAP 0x01
00248
#define IP6A_HASEEN 0x02
00249
#define IP6A_BRUID 0x04
00250
#define IP6A_RTALERTSEEN 0x08
00251
00252
00253
struct in6_addr ip6a_careof;
00254
struct in6_addr ip6a_home;
00255 u_int16_t ip6a_bruid;
00256
00257
00258
struct in6_ifaddr *ip6a_dstia6;
00259
00260
00261 u_int16_t ip6a_rtalert;
00262
00263
00264
00265
00266
00267 };
00268
#endif
00269
00270
#ifdef _KERNEL
00271
00272
#define IPV6_DADOUTPUT 0x01
00273
#define IPV6_FORWARDING 0x02
00274
#define IPV6_MINMTU 0x04
00275
00276
extern struct ip6stat ip6stat;
00277
extern u_int32_t ip6_id;
00278
extern int ip6_defhlim;
00279
extern int ip6_defmcasthlim;
00280
extern int ip6_forwarding;
00281
extern int ip6_forward_srcrt;
00282
extern int ip6_gif_hlim;
00283
extern int ip6_use_deprecated;
00284
extern int ip6_rr_prune;
00285
00286
extern int ip6_v6only;
00287
00288
extern struct socket *ip6_mrouter;
00289
extern int ip6_sendredirects;
00290
extern int ip6_maxfragpackets;
00291
extern int ip6_sourcecheck;
00292
extern int ip6_sourcecheck_interval;
00293
extern int ip6_accept_rtadv;
00294
extern int ip6_keepfaith;
00295
extern int ip6_log_interval;
00296
extern time_t ip6_log_time;
00297
extern int ip6_hdrnestlimit;
00298
extern int ip6_dad_count;
00299
00300
extern u_int32_t ip6_flow_seq;
00301
extern int ip6_auto_flowlabel;
00302
extern int ip6_auto_linklocal;
00303
00304
extern int ip6_anonportmin;
00305
extern int ip6_anonportmax;
00306
extern int ip6_lowportmin;
00307
extern int ip6_lowportmax;
00308
00309
extern int ip6_use_tempaddr;
00310
00311
extern struct pr_usrreqs rip6_usrreqs;
00312
struct sockopt;
00313
00314
struct inpcb;
00315
00316
int icmp6_ctloutput __P((
struct socket *,
struct sockopt *sopt));
00317
00318
struct in6_ifaddr;
00319
void ip6_init __P((
void));
00320
void ip6intr __P((
void));
00321
void ip6_input __P((
struct mbuf *));
00322
struct in6_ifaddr *ip6_getdstifaddr __P((
struct mbuf *));
00323
void ip6_freepcbopts __P((
struct ip6_pktopts *));
00324
void ip6_freemoptions __P((
struct ip6_moptions *));
00325
int ip6_unknown_opt __P((u_int8_t *,
struct mbuf *,
int));
00326
char * ip6_get_prevhdr __P((
struct mbuf *,
int));
00327
int ip6_nexthdr __P((
struct mbuf *,
int,
int,
int *));
00328
int ip6_lasthdr __P((
struct mbuf *,
int,
int,
int *));
00329
00330
struct mbuf *ip6_addaux __P((
struct mbuf *));
00331
struct mbuf *ip6_findaux __P((
struct mbuf *));
00332
void ip6_delaux __P((
struct mbuf *));
00333
00334
int ip6_mforward __P((
struct ip6_hdr *,
struct ifnet *,
struct mbuf *));
00335
int ip6_process_hopopts __P((
struct mbuf *, u_int8_t *,
int, u_int32_t *,
00336 u_int32_t *));
00337
void ip6_savecontrol __P((
struct inpcb *,
struct mbuf **,
struct ip6_hdr *,
00338
struct mbuf *));
00339
void ip6_notify_pmtu __P((
struct inpcb *,
struct sockaddr_in6 *,
00340 u_int32_t *));
00341
int ip6_sysctl __P((
int *, u_int,
void *, size_t *,
void *, size_t));
00342
00343
void ip6_forward __P((
struct mbuf *,
int));
00344
00345
void ip6_mloopback __P((
struct ifnet *,
struct mbuf *,
struct sockaddr_in6 *));
00346
int ip6_output __P((
struct mbuf *,
struct ip6_pktopts *,
00347
struct route_in6 *,
00348
int,
00349
struct ip6_moptions *,
struct ifnet **));
00350
int ip6_ctloutput __P((
struct socket *,
struct sockopt *sopt));
00351
void init_ip6pktopts __P((
struct ip6_pktopts *));
00352
int ip6_setpktoptions __P((
struct mbuf *,
struct ip6_pktopts *,
int,
int));
00353
void ip6_clearpktopts __P((
struct ip6_pktopts *,
int,
int));
00354
struct ip6_pktopts *ip6_copypktopts __P((
struct ip6_pktopts *,
int));
00355
int ip6_optlen __P((
struct inpcb *));
00356
00357
int route6_input __P((
struct mbuf **,
int *,
int));
00358
00359
void frag6_init __P((
void));
00360
int frag6_input __P((
struct mbuf **,
int *,
int));
00361
void frag6_slowtimo __P((
void));
00362
void frag6_drain __P((
void));
00363
00364
void rip6_init __P((
void));
00365
int rip6_input __P((
struct mbuf **mp,
int *offp,
int proto));
00366
void rip6_ctlinput __P((
int,
struct sockaddr *,
void *));
00367
int rip6_ctloutput __P((
struct socket *so,
struct sockopt *sopt));
00368
int rip6_output __P((
struct mbuf *, ...));
00369
int rip6_usrreq __P((
struct socket *,
00370
int,
struct mbuf *,
struct mbuf *,
struct mbuf *,
struct thread *));
00371
00372
int dest6_input __P((
struct mbuf **,
int *,
int));
00373
int none_input __P((
struct mbuf **,
int *,
int));
00374
#endif
00375
00376
#endif