Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/udp_var.h
Show All 30 Lines | |||||
* | * | ||||
* @(#)udp_var.h 8.1 (Berkeley) 6/10/93 | * @(#)udp_var.h 8.1 (Berkeley) 6/10/93 | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _NETINET_UDP_VAR_H_ | #ifndef _NETINET_UDP_VAR_H_ | ||||
#define _NETINET_UDP_VAR_H_ | #define _NETINET_UDP_VAR_H_ | ||||
#include <sys/types.h> | |||||
#include <netinet/ip_var.h> | #include <netinet/ip_var.h> | ||||
#include <netinet/udp.h> | #include <netinet/udp.h> | ||||
/* | /* | ||||
* UDP kernel structures and variables. | * UDP kernel structures and variables. | ||||
*/ | */ | ||||
struct udpiphdr { | struct udpiphdr { | ||||
struct ipovly ui_i; /* overlaid ip structure */ | struct ipovly ui_i; /* overlaid ip structure */ | ||||
struct udphdr ui_u; /* udp header */ | struct udphdr ui_u; /* udp header */ | ||||
}; | }; | ||||
#define ui_x1 ui_i.ih_x1 | #define ui_x1 ui_i.ih_x1 | ||||
#define ui_v ui_i.ih_x1[0] | #define ui_v ui_i.ih_x1[0] | ||||
#define ui_pr ui_i.ih_pr | #define ui_pr ui_i.ih_pr | ||||
#define ui_len ui_i.ih_len | #define ui_len ui_i.ih_len | ||||
#define ui_src ui_i.ih_src | #define ui_src ui_i.ih_src | ||||
#define ui_dst ui_i.ih_dst | #define ui_dst ui_i.ih_dst | ||||
#define ui_sport ui_u.uh_sport | #define ui_sport ui_u.uh_sport | ||||
#define ui_dport ui_u.uh_dport | #define ui_dport ui_u.uh_dport | ||||
#define ui_ulen ui_u.uh_ulen | #define ui_ulen ui_u.uh_ulen | ||||
#define ui_sum ui_u.uh_sum | #define ui_sum ui_u.uh_sum | ||||
struct inpcb; | struct inpcb; | ||||
struct mbuf; | struct mbuf; | ||||
typedef void(*udp_tun_func_t)(struct mbuf *, int, struct inpcb *, | #ifdef _KERNEL | ||||
typedef bool(*udp_tun_func_t)(struct mbuf *, int, struct inpcb *, | |||||
const struct sockaddr *, void *); | const struct sockaddr *, void *); | ||||
typedef void(*udp_tun_icmp_t)(int, struct sockaddr *, void *, void *); | typedef void(*udp_tun_icmp_t)(int, struct sockaddr *, void *, void *); | ||||
/* | /* | ||||
* UDP control block; one per udp. | * UDP control block; one per udp. | ||||
*/ | */ | ||||
struct udpcb { | struct udpcb { | ||||
udp_tun_func_t u_tun_func; /* UDP kernel tunneling callback. */ | udp_tun_func_t u_tun_func; /* UDP kernel tunneling callback. */ | ||||
udp_tun_icmp_t u_icmp_func; /* UDP kernel tunneling icmp callback */ | udp_tun_icmp_t u_icmp_func; /* UDP kernel tunneling icmp callback */ | ||||
u_int u_flags; /* Generic UDP flags. */ | u_int u_flags; /* Generic UDP flags. */ | ||||
uint16_t u_rxcslen; /* Coverage for incoming datagrams. */ | uint16_t u_rxcslen; /* Coverage for incoming datagrams. */ | ||||
uint16_t u_txcslen; /* Coverage for outgoing datagrams. */ | uint16_t u_txcslen; /* Coverage for outgoing datagrams. */ | ||||
void *u_tun_ctx; /* Tunneling callback context. */ | void *u_tun_ctx; /* Tunneling callback context. */ | ||||
}; | }; | ||||
#define intoudpcb(ip) ((struct udpcb *)(ip)->inp_ppcb) | #define intoudpcb(ip) ((struct udpcb *)(ip)->inp_ppcb) | ||||
#define sotoudpcb(so) (intoudpcb(sotoinpcb(so))) | #define sotoudpcb(so) (intoudpcb(sotoinpcb(so))) | ||||
#endif | |||||
/* IPsec: ESP in UDP tunneling: */ | /* IPsec: ESP in UDP tunneling: */ | ||||
#define UF_ESPINUDP_NON_IKE 0x00000001 /* w/ non-IKE marker .. */ | #define UF_ESPINUDP_NON_IKE 0x00000001 /* w/ non-IKE marker .. */ | ||||
/* .. per draft-ietf-ipsec-nat-t-ike-0[01], | /* .. per draft-ietf-ipsec-nat-t-ike-0[01], | ||||
* and draft-ietf-ipsec-udp-encaps-(00/)01.txt */ | * and draft-ietf-ipsec-udp-encaps-(00/)01.txt */ | ||||
#define UF_ESPINUDP 0x00000002 /* w/ non-ESP marker. */ | #define UF_ESPINUDP 0x00000002 /* w/ non-ESP marker. */ | ||||
struct udpstat { | struct udpstat { | ||||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |