need time.h if no user.h
[unix-history] / usr / src / sys / netinet / udp_var.h
CommitLineData
8ae0e4b4 1/*
f6147693 2 * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
2b6b6284 3 * All rights reserved.
8ae0e4b4 4 *
2b6b6284 5 * Redistribution and use in source and binary forms are permitted
616d42db
KB
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2b6b6284 16 *
43f80dd3 17 * @(#)udp_var.h 7.6 (Berkeley) %G%
8ae0e4b4 18 */
dcfc0daf 19
2b4b57cd
BJ
20/*
21 * UDP kernel structures and variables.
22 */
eb44bfb2
BJ
23struct udpiphdr {
24 struct ipovly ui_i; /* overlaid ip structure */
25 struct udphdr ui_u; /* udp header */
26};
27#define ui_next ui_i.ih_next
28#define ui_prev ui_i.ih_prev
29#define ui_x1 ui_i.ih_x1
30#define ui_pr ui_i.ih_pr
31#define ui_len ui_i.ih_len
32#define ui_src ui_i.ih_src
33#define ui_dst ui_i.ih_dst
34#define ui_sport ui_u.uh_sport
35#define ui_dport ui_u.uh_dport
36#define ui_ulen ui_u.uh_ulen
37#define ui_sum ui_u.uh_sum
38
2b4b57cd 39struct udpstat {
43f80dd3
MK
40 /* input statistics: */
41 int udps_ipackets; /* total input packets */
42 int udps_hdrops; /* packet shorter than header */
43 int udps_badsum; /* checksum error */
44 int udps_badlen; /* data length larger than packet */
45 int udps_noport; /* no socket on port */
46 int udps_noportbcast; /* of above, arrived as broadcast */
47 int udps_fullsock; /* not delivered, input socket full */
48 int udpps_pcbcachemiss; /* input packets missing pcb cache */
49 /* output statistics: */
50 int udps_opackets; /* total output packets */
2b4b57cd
BJ
51};
52
43f80dd3 53#define UDP_TTL 30 /* default time to live for UDP packets */
1820d4e3 54
eb44bfb2 55#ifdef KERNEL
dcfc0daf 56struct inpcb udb;
2b4b57cd 57struct udpstat udpstat;
eb44bfb2 58#endif