Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_var.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
struct ipovly { | struct ipovly { | ||||
u_char ih_x1[9]; /* (unused) */ | u_char ih_x1[9]; /* (unused) */ | ||||
u_char ih_pr; /* protocol */ | u_char ih_pr; /* protocol */ | ||||
u_short ih_len; /* protocol length */ | u_short ih_len; /* protocol length */ | ||||
struct in_addr ih_src; /* source internet address */ | struct in_addr ih_src; /* source internet address */ | ||||
struct in_addr ih_dst; /* destination internet address */ | struct in_addr ih_dst; /* destination internet address */ | ||||
}; | }; | ||||
#ifdef _KERNEL | #if defined(_KERNEL) || defined(_KERNEL_UT) | ||||
/* | /* | ||||
* Ip reassembly queue structure. Each fragment | * Ip reassembly queue structure. Each fragment | ||||
* being reassembled is attached to one of these structures. | * being reassembled is attached to one of these structures. | ||||
* They are timed out after ipq_ttl drops to 0, and may also | * They are timed out after ipq_ttl drops to 0, and may also | ||||
* be reclaimed if memory becomes tight. | * be reclaimed if memory becomes tight. | ||||
*/ | */ | ||||
struct ipq { | struct ipq { | ||||
TAILQ_ENTRY(ipq) ipq_list; /* to other reass headers */ | TAILQ_ENTRY(ipq) ipq_list; /* to other reass headers */ | ||||
u_char ipq_ttl; /* time for reass q to live */ | u_char ipq_ttl; /* time for reass q to live */ | ||||
u_char ipq_p; /* protocol of this fragment */ | u_char ipq_p; /* protocol of this fragment */ | ||||
u_short ipq_id; /* sequence id for reassembly */ | u_short ipq_id; /* sequence id for reassembly */ | ||||
int ipq_maxoff; /* total length of packet */ | int ipq_maxoff; /* total length of packet */ | ||||
struct mbuf *ipq_frags; /* to ip headers of fragments */ | struct mbuf *ipq_frags; /* to ip headers of fragments */ | ||||
struct in_addr ipq_src,ipq_dst; | struct in_addr ipq_src,ipq_dst; | ||||
u_char ipq_nfrags; /* # frags in this packet */ | u_char ipq_nfrags; /* # frags in this packet */ | ||||
struct label *ipq_label; /* MAC label */ | struct label *ipq_label; /* MAC label */ | ||||
}; | }; | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL || _KERNEL_UT */ | ||||
/* | /* | ||||
* Structure stored in mbuf in inpcb.ip_options | * Structure stored in mbuf in inpcb.ip_options | ||||
* and passed to ip_output when ip options are in use. | * and passed to ip_output when ip options are in use. | ||||
* The actual length of the options (including ipopt_dst) | * The actual length of the options (including ipopt_dst) | ||||
* is in m_len. | * is in m_len. | ||||
*/ | */ | ||||
#define MAX_IPOPTLEN 40 | #define MAX_IPOPTLEN 40 | ||||
struct ipoption { | struct ipoption { | ||||
struct in_addr ipopt_dst; /* first-hop dst if source routed */ | struct in_addr ipopt_dst; /* first-hop dst if source routed */ | ||||
char ipopt_list[MAX_IPOPTLEN]; /* options proper */ | char ipopt_list[MAX_IPOPTLEN]; /* options proper */ | ||||
}; | }; | ||||
#if defined(_NETINET_IN_VAR_H_) && defined(_KERNEL) | #if defined(_NETINET_IN_VAR_H_) && (defined(_KERNEL) \ | ||||
|| defined(_KERNEL_UT)) | |||||
/* | /* | ||||
* Structure attached to inpcb.ip_moptions and | * Structure attached to inpcb.ip_moptions and | ||||
* passed to ip_output when IP multicast options are in use. | * passed to ip_output when IP multicast options are in use. | ||||
* This structure is lazy-allocated. | * This structure is lazy-allocated. | ||||
*/ | */ | ||||
struct ip_moptions { | struct ip_moptions { | ||||
struct ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */ | struct ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */ | ||||
struct in_addr imo_multicast_addr; /* ifindex/addr on MULTICAST_IF */ | struct in_addr imo_multicast_addr; /* ifindex/addr on MULTICAST_IF */ | ||||
Show All 33 Lines | struct ipstat { | ||||
uint64_t ips_badvers; /* ip version != 4 */ | uint64_t ips_badvers; /* ip version != 4 */ | ||||
uint64_t ips_rawout; /* total raw ip packets generated */ | uint64_t ips_rawout; /* total raw ip packets generated */ | ||||
uint64_t ips_toolong; /* ip length > max ip packet size */ | uint64_t ips_toolong; /* ip length > max ip packet size */ | ||||
uint64_t ips_notmember; /* multicasts for unregistered grps */ | uint64_t ips_notmember; /* multicasts for unregistered grps */ | ||||
uint64_t ips_nogif; /* no match gif found */ | uint64_t ips_nogif; /* no match gif found */ | ||||
uint64_t ips_badaddr; /* invalid address on header */ | uint64_t ips_badaddr; /* invalid address on header */ | ||||
}; | }; | ||||
#ifdef _KERNEL | #if defined(_KERNEL) || defined(_KERNEL_UT) | ||||
#include <sys/counter.h> | #include <sys/counter.h> | ||||
#include <net/vnet.h> | #include <net/vnet.h> | ||||
VNET_PCPUSTAT_DECLARE(struct ipstat, ipstat); | VNET_PCPUSTAT_DECLARE(struct ipstat, ipstat); | ||||
/* | /* | ||||
* In-kernel consumers can use these accessor macros directly to update | * In-kernel consumers can use these accessor macros directly to update | ||||
* stats. | * stats. | ||||
▲ Show 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | |||||
#define V_ip_fw_ctl_ptr VNET(ip_fw_ctl_ptr) | #define V_ip_fw_ctl_ptr VNET(ip_fw_ctl_ptr) | ||||
/* Divert hooks. */ | /* Divert hooks. */ | ||||
extern void (*ip_divert_ptr)(struct mbuf *m, bool incoming); | extern void (*ip_divert_ptr)(struct mbuf *m, bool incoming); | ||||
/* ng_ipfw hooks -- XXX make it the same as divert and dummynet */ | /* ng_ipfw hooks -- XXX make it the same as divert and dummynet */ | ||||
extern int (*ng_ipfw_input_p)(struct mbuf **, struct ip_fw_args *, bool); | extern int (*ng_ipfw_input_p)(struct mbuf **, struct ip_fw_args *, bool); | ||||
extern int (*ip_dn_ctl_ptr)(struct sockopt *); | extern int (*ip_dn_ctl_ptr)(struct sockopt *); | ||||
extern int (*ip_dn_io_ptr)(struct mbuf **, struct ip_fw_args *); | extern int (*ip_dn_io_ptr)(struct mbuf **, struct ip_fw_args *); | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL || _KERNEL_UT */ | ||||
#endif /* !_NETINET_IP_VAR_H_ */ | #endif /* !_NETINET_IP_VAR_H_ */ |