Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_var.h
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | struct ipstat { | ||||
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 | #ifdef _KERNEL | ||||
#include <sys/counter.h> | #include <sys/counter.h> | ||||
#include <net/vnet.h> | #include <net/vnet.h> | ||||
#include <netinet/in_kdtrace.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. | ||||
*/ | */ | ||||
#define IPSTAT_ADD(name, val) \ | #define IPSTAT_ADD(name, val) \ | ||||
VNET_PCPUSTAT_ADD(struct ipstat, ipstat, name, (val)) | do { \ | ||||
SDT_PROBE2(mib, ip, , count, #name, (val)); \ | |||||
VNET_PCPUSTAT_ADD(struct ipstat, ipstat, name, (val)); \ | |||||
} while (0) | |||||
#define IPSTAT_SUB(name, val) IPSTAT_ADD(name, -(val)) | #define IPSTAT_SUB(name, val) IPSTAT_ADD(name, -(val)) | ||||
#define IPSTAT_INC(name) IPSTAT_ADD(name, 1) | #define IPSTAT_INC(name) IPSTAT_ADD(name, 1) | ||||
#define IPSTAT_DEC(name) IPSTAT_SUB(name, 1) | #define IPSTAT_DEC(name) IPSTAT_SUB(name, 1) | ||||
/* | /* | ||||
* Kernel module consumers must use this accessor macro. | * Kernel module consumers must use this accessor macro. | ||||
*/ | */ | ||||
void kmod_ipstat_inc(int statnum); | void kmod_ipstat_inc(int statnum); | ||||
#define KMOD_IPSTAT_INC(name) \ | #define KMOD_IPSTAT_INC(name) \ | ||||
kmod_ipstat_inc(offsetof(struct ipstat, name) / sizeof(uint64_t)) | do { \ | ||||
SDT_PROBE2(mib, ip, , count, #name, 1); \ | |||||
kmod_ipstat_inc( \ | |||||
offsetof(struct ipstat, name) / sizeof(uint64_t)); \ | |||||
} while (0) | |||||
void kmod_ipstat_dec(int statnum); | void kmod_ipstat_dec(int statnum); | ||||
#define KMOD_IPSTAT_DEC(name) \ | #define KMOD_IPSTAT_DEC(name) \ | ||||
kmod_ipstat_dec(offsetof(struct ipstat, name) / sizeof(uint64_t)) | do { \ | ||||
SDT_PROBE2(ip, , , count, #name, -1); \ | |||||
kmod_ipstat_dec( \ | |||||
offsetof(struct ipstat, name) / sizeof(uint64_t)); \ | |||||
} while (0) | |||||
/* flags passed to ip_output as last parameter */ | /* flags passed to ip_output as last parameter */ | ||||
#define IP_FORWARDING 0x1 /* most of ip header exists */ | #define IP_FORWARDING 0x1 /* most of ip header exists */ | ||||
#define IP_RAWOUTPUT 0x2 /* raw ip header exists */ | #define IP_RAWOUTPUT 0x2 /* raw ip header exists */ | ||||
#define IP_SENDONES 0x4 /* send all-ones broadcast */ | #define IP_SENDONES 0x4 /* send all-ones broadcast */ | ||||
#define IP_SENDTOIF 0x8 /* send on specific ifnet */ | #define IP_SENDTOIF 0x8 /* send on specific ifnet */ | ||||
#define IP_ROUTETOIF SO_DONTROUTE /* 0x10 bypass routing tables */ | #define IP_ROUTETOIF SO_DONTROUTE /* 0x10 bypass routing tables */ | ||||
#define IP_ALLOWBROADCAST SO_BROADCAST /* 0x20 can send broadcast packets */ | #define IP_ALLOWBROADCAST SO_BROADCAST /* 0x20 can send broadcast packets */ | ||||
▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines |