Changeset View
Standalone View
sys/netinet/in.h
Show First 20 Lines • Show All 374 Lines • ▼ Show 20 Lines | |||||
#ifdef IN_HISTORICAL_NETS | #ifdef IN_HISTORICAL_NETS | ||||
#define IN_CLASSD(i) IN_MULTICAST(i) | #define IN_CLASSD(i) IN_MULTICAST(i) | ||||
#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ | #define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ | ||||
#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ | #define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ | ||||
#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ | #define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ | ||||
#endif /* IN_HISTORICAL_NETS */ | #endif /* IN_HISTORICAL_NETS */ | ||||
#define IN_EXPERIMENTAL(i) (((in_addr_t)(i) & 0xf0000000) == 0xf0000000) | #define IN_EXPERIMENTAL(i) (((in_addr_t)(i) & 0xf0000000) == 0xf0000000) | ||||
#define IN_BADCLASS(i) (((in_addr_t)(i) & 0xf0000000) == 0xf0000000) | #define IN_BADCLASS(i) (((in_addr_t)(i) & 0xf0000000) == 0xf0000000) | ||||
glebius: IMHO, this define should go away. Not used anywhere and with proposed changes is no longer… | |||||
Done Inline ActionsI'd be nervous that IN_BADCLASS was used somewhere, e.g. ports. I see that it is also in NetBSD's in.h at least. If it were dynamic, I'd make it "false" when allow_experimental was set, but that doesn't work for user level. karels: I'd be nervous that IN_BADCLASS was used somewhere, e.g. ports. I see that it is also in… | |||||
#define IN_LINKLOCAL(i) (((in_addr_t)(i) & 0xffff0000) == 0xa9fe0000) | #define IN_LINKLOCAL(i) (((in_addr_t)(i) & 0xffff0000) == 0xa9fe0000) | ||||
#ifdef _KERNEL | |||||
#define IN_LOOPBACK(i) \ | |||||
(((in_addr_t)(i) & V_in_loopback_mask) == 0x7f000000) | |||||
#define IN_LOOPBACK_MASK_DFLT 0xff000000 | |||||
#else | |||||
#define IN_LOOPBACK(i) (((in_addr_t)(i) & 0xff000000) == 0x7f000000) | #define IN_LOOPBACK(i) (((in_addr_t)(i) & 0xff000000) == 0x7f000000) | ||||
#endif | |||||
#define IN_ZERONET(i) (((in_addr_t)(i) & 0xff000000) == 0) | #define IN_ZERONET(i) (((in_addr_t)(i) & 0xff000000) == 0) | ||||
#define IN_PRIVATE(i) ((((in_addr_t)(i) & 0xff000000) == 0x0a000000) || \ | #define IN_PRIVATE(i) ((((in_addr_t)(i) & 0xff000000) == 0x0a000000) || \ | ||||
(((in_addr_t)(i) & 0xfff00000) == 0xac100000) || \ | (((in_addr_t)(i) & 0xfff00000) == 0xac100000) || \ | ||||
(((in_addr_t)(i) & 0xffff0000) == 0xc0a80000)) | (((in_addr_t)(i) & 0xffff0000) == 0xc0a80000)) | ||||
#define IN_LOCAL_GROUP(i) (((in_addr_t)(i) & 0xffffff00) == 0xe0000000) | #define IN_LOCAL_GROUP(i) (((in_addr_t)(i) & 0xffffff00) == 0xe0000000) | ||||
Show All 13 Lines | |||||
#define INADDR_ALLMDNS_GROUP ((in_addr_t)0xe00000fb) /* 224.0.0.251 */ | #define INADDR_ALLMDNS_GROUP ((in_addr_t)0xe00000fb) /* 224.0.0.251 */ | ||||
#define INADDR_MAX_LOCAL_GROUP ((in_addr_t)0xe00000ff) /* 224.0.0.255 */ | #define INADDR_MAX_LOCAL_GROUP ((in_addr_t)0xe00000ff) /* 224.0.0.255 */ | ||||
#ifdef IN_HISTORICAL_NETS | #ifdef IN_HISTORICAL_NETS | ||||
#define IN_LOOPBACKNET 127 /* official! */ | #define IN_LOOPBACKNET 127 /* official! */ | ||||
#endif /* IN_HISTORICAL_NETS */ | #endif /* IN_HISTORICAL_NETS */ | ||||
#define IN_RFC3021_MASK ((in_addr_t)0xfffffffe) | #define IN_RFC3021_MASK ((in_addr_t)0xfffffffe) | ||||
#ifdef _KERNEL | |||||
#include <net/vnet.h> | |||||
Not Done Inline ActionsHERE ... you need sys/param.h in all files includeing this or just right above this line and not in vnet.h. Though I am not sure what @imp 's "header files should be self-contained" thinks about all this... bz: HERE ... you need sys/param.h in all files includeing this or just right above this line and… | |||||
Done Inline ActionsI did make -i and got 16 errors; some might be duplicates due to modules. iwlwifi was among them, via an ipv6.h include in linuxkpi. I was thinking of imp's recent statement when putting the fix into vnet.h. But I'm not sure what in_var.h has to do with this; fewer things need in_var.h than in.h. karels: I did make -i and got 16 errors; some might be duplicates due to modules. iwlwifi was among… | |||||
Not Done Inline ActionsI am just wondering if the VNET_DELCARE and #define actually belong into in_var.h as they have nothing to do with the protocol spec itself and in_var.h is where the other VNET specifics for "in" are... bz: I am just wondering if the VNET_DELCARE and #define actually belong into in_var.h as they have… | |||||
VNET_DECLARE(bool, ip_allow_net0); | |||||
VNET_DECLARE(bool, ip_allow_net240); | |||||
Done Inline ActionsMaybe not "experimental"; may call them by their blocks? ip_allow_net0, ip_allow_net240 or ip_allow_class_e or something... And same for the sysctl names then. bz: Maybe not "experimental"; may call them by their blocks? ip_allow_net0, ip_allow_net240 or… | |||||
Done Inline ActionsI like the numeric versions; any objections from anyone else? karels: I like the numeric versions; any objections from anyone else? | |||||
/* Address space reserved for loopback */ | |||||
VNET_DECLARE(uint32_t, in_loopback_mask); | |||||
#define V_ip_allow_net0 VNET(ip_allow_net0) | |||||
#define V_ip_allow_net240 VNET(ip_allow_net240) | |||||
#define V_in_loopback_mask VNET(in_loopback_mask) | |||||
#endif | |||||
/* | /* | ||||
* Options for use with [gs]etsockopt at the IP level. | * Options for use with [gs]etsockopt at the IP level. | ||||
* First word of comment is data type; bool is stored in int. | * First word of comment is data type; bool is stored in int. | ||||
*/ | */ | ||||
#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */ | #define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */ | ||||
#define IP_HDRINCL 2 /* int; header is included with data */ | #define IP_HDRINCL 2 /* int; header is included with data */ | ||||
#define IP_TOS 3 /* int; IP type of service and preced. */ | #define IP_TOS 3 /* int; IP type of service and preced. */ | ||||
▲ Show 20 Lines • Show All 267 Lines • Show Last 20 Lines |
IMHO, this define should go away. Not used anywhere and with proposed changes is no longer correct.