xref: /original-bsd/sys/deprecated/bbnnet/udp.h (revision 2c497c00)
1 #define RCSUDPHDR "$Header: udp.h,v 1.1 84/04/05 15:23:56 walsh Exp $"
2 
3 struct udp {			/* user dgram proto leader (fits over ip hdr) */
4 	char		u_x[8];		/* unused fields from ip */
5 	u_char		u_x1;		/* unused */
6 	u_char		u_pr;		/* protocol number */
7 	u_short		u_ilen;		/* pseudo header length == UDP length */
8 	struct in_addr	u_s;		/* source internet address */
9 	struct in_addr	u_d;		/* destination internet address */
10 	u_short		u_src;		/* source port */
11 	u_short		u_dst;		/* destination port */
12 	u_short		u_len;		/* length */
13 	u_short		u_sum;		/* checksum */
14 };
15 
16 #define UDPSIZE 8			/* UDP header only */
17 #define UDPCKSIZE 12			/* UDP pseudo header */
18 
19 struct udp_stat {
20     struct in_stat u_in;
21 #define u_total		u_in.in_total
22 #define u_badsum	u_in.in_badsum
23 #define u_tooshort	u_in.in_tooshort
24 #define u_drops		u_in.in_drops
25     int u_sonospace;		/* #udp pkts user socket rcv buf full (drop) */
26     int u_nobuf;		/* #udp pkts can't m_get for socket code */
27 };
28 
29 /*
30  * UDP port information
31  */
32 
33 #define UDP_RESERVED		1023
34 #define UDP_USERRESERVED	5000
35 #define UDP_MAXPORT		0xffff
36 
37 #ifdef KERNEL
38 extern struct udp_stat udpstat;
39 char *udp_conn_used();
40 #endif
41