1 /* 2 * Copyright (c) 1982, 1986, 1989 Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)udp_var.h 7.8 (Berkeley) 01/08/93 8 */ 9 10 /* 11 * UDP kernel structures and variables. 12 */ 13 struct udpiphdr { 14 struct ipovly ui_i; /* overlaid ip structure */ 15 struct udphdr ui_u; /* udp header */ 16 }; 17 #define ui_next ui_i.ih_next 18 #define ui_prev ui_i.ih_prev 19 #define ui_x1 ui_i.ih_x1 20 #define ui_pr ui_i.ih_pr 21 #define ui_len ui_i.ih_len 22 #define ui_src ui_i.ih_src 23 #define ui_dst ui_i.ih_dst 24 #define ui_sport ui_u.uh_sport 25 #define ui_dport ui_u.uh_dport 26 #define ui_ulen ui_u.uh_ulen 27 #define ui_sum ui_u.uh_sum 28 29 struct udpstat { 30 /* input statistics: */ 31 u_long udps_ipackets; /* total input packets */ 32 u_long udps_hdrops; /* packet shorter than header */ 33 u_long udps_badsum; /* checksum error */ 34 u_long udps_badlen; /* data length larger than packet */ 35 u_long udps_noport; /* no socket on port */ 36 u_long udps_noportbcast; /* of above, arrived as broadcast */ 37 u_long udps_fullsock; /* not delivered, input socket full */ 38 u_long udpps_pcbcachemiss; /* input packets missing pcb cache */ 39 /* output statistics: */ 40 u_long udps_opackets; /* total output packets */ 41 }; 42 43 #define UDP_TTL 30 /* default time to live for UDP packets */ 44 45 #ifdef KERNEL 46 struct inpcb udb; 47 struct udpstat udpstat; 48 #endif 49