xref: /csrg-svn/sys/netinet/udp_var.h (revision 63218)
123200Smckusick /*
2*63218Sbostic  * Copyright (c) 1982, 1986, 1989, 1993
3*63218Sbostic  *	The Regents of the University of California.  All rights reserved.
423200Smckusick  *
544556Sbostic  * %sccs.include.redist.c%
632789Sbostic  *
7*63218Sbostic  *	@(#)udp_var.h	8.1 (Berkeley) 06/10/93
823200Smckusick  */
94895Swnj 
104926Swnj /*
114926Swnj  * UDP kernel structures and variables.
124926Swnj  */
134901Swnj struct	udpiphdr {
144901Swnj 	struct 	ipovly ui_i;		/* overlaid ip structure */
154901Swnj 	struct	udphdr ui_u;		/* udp header */
164901Swnj };
174901Swnj #define	ui_next		ui_i.ih_next
184901Swnj #define	ui_prev		ui_i.ih_prev
194901Swnj #define	ui_x1		ui_i.ih_x1
204901Swnj #define	ui_pr		ui_i.ih_pr
214901Swnj #define	ui_len		ui_i.ih_len
224901Swnj #define	ui_src		ui_i.ih_src
234901Swnj #define	ui_dst		ui_i.ih_dst
244901Swnj #define	ui_sport	ui_u.uh_sport
254901Swnj #define	ui_dport	ui_u.uh_dport
264901Swnj #define	ui_ulen		ui_u.uh_ulen
274901Swnj #define	ui_sum		ui_u.uh_sum
284901Swnj 
294926Swnj struct	udpstat {
3044377Skarels 				/* input statistics: */
3157433Sandrew 	u_long	udps_ipackets;		/* total input packets */
3257433Sandrew 	u_long	udps_hdrops;		/* packet shorter than header */
3357433Sandrew 	u_long	udps_badsum;		/* checksum error */
3457433Sandrew 	u_long	udps_badlen;		/* data length larger than packet */
3557433Sandrew 	u_long	udps_noport;		/* no socket on port */
3657433Sandrew 	u_long	udps_noportbcast;	/* of above, arrived as broadcast */
3757433Sandrew 	u_long	udps_fullsock;		/* not delivered, input socket full */
3857433Sandrew 	u_long	udpps_pcbcachemiss;	/* input packets missing pcb cache */
3944377Skarels 				/* output statistics: */
4057433Sandrew 	u_long	udps_opackets;		/* total output packets */
414926Swnj };
424926Swnj 
4359310Smckusick /*
4459310Smckusick  * Names for UDP sysctl objects
4559310Smckusick  */
4659664Storek #define	UDPCTL_CHECKSUM		1	/* checksum UDP packets */
4759310Smckusick #define UDPCTL_MAXID		2
4859310Smckusick 
4959310Smckusick #define UDPCTL_NAMES { \
5059310Smckusick 	{ 0, 0 }, \
5159310Smckusick 	{ "checksum", CTLTYPE_INT }, \
5259310Smckusick }
5359310Smckusick 
544901Swnj #ifdef KERNEL
554895Swnj struct	inpcb udb;
564926Swnj struct	udpstat udpstat;
5761335Sbostic 
5861335Sbostic void	 udp_ctlinput __P((int, struct sockaddr *, struct ip *));
5961335Sbostic void	 udp_init __P((void));
6061335Sbostic void	 udp_input __P((struct mbuf *, int));
6161335Sbostic int	 udp_output __P((struct inpcb *,
6261335Sbostic 	    struct mbuf *, struct mbuf *, struct mbuf *));
6361335Sbostic int	 udp_sysctl __P((int *, u_int, void *, size_t *, void *, size_t));
6461335Sbostic int	 udp_usrreq __P((struct socket *,
6561335Sbostic 	    int, struct mbuf *, struct mbuf *, struct mbuf *));
664901Swnj #endif
67