Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in.h
Show First 20 Lines • Show All 336 Lines • ▼ Show 20 Lines | |||||
* 512, but that conflicts with some well-known-services that firewalls may | * 512, but that conflicts with some well-known-services that firewalls may | ||||
* have a fit if we use. | * have a fit if we use. | ||||
*/ | */ | ||||
#define IPPORT_RESERVEDSTART 600 | #define IPPORT_RESERVEDSTART 600 | ||||
#define IPPORT_MAX 65535 | #define IPPORT_MAX 65535 | ||||
/* | /* | ||||
* Definitions of bits in internet address integers. | * Historical definitions of bits in internet address integers | ||||
* On subnets, the decomposition of addresses to host and net parts | * (pre-CIDR). Class A/B/C are long obsolete, and now deprecated. | ||||
* is done according to subnet mask, not the masks here. | * Hide these definitions from the kernel unless IN_HISTORICAL_NETS | ||||
* is defined. Provide the historical definitions to user level for now. | |||||
*/ | */ | ||||
#ifndef _KERNEL | |||||
#define IN_HISTORICAL_NETS | |||||
#endif | |||||
#ifdef IN_HISTORICAL_NETS | |||||
#define IN_CLASSA(i) (((in_addr_t)(i) & 0x80000000) == 0) | #define IN_CLASSA(i) (((in_addr_t)(i) & 0x80000000) == 0) | ||||
#define IN_CLASSA_NET 0xff000000 | #define IN_CLASSA_NET 0xff000000 | ||||
#define IN_CLASSA_NSHIFT 24 | #define IN_CLASSA_NSHIFT 24 | ||||
#define IN_CLASSA_HOST 0x00ffffff | #define IN_CLASSA_HOST 0x00ffffff | ||||
#define IN_CLASSA_MAX 128 | #define IN_CLASSA_MAX 128 | ||||
#define IN_CLASSB(i) (((in_addr_t)(i) & 0xc0000000) == 0x80000000) | #define IN_CLASSB(i) (((in_addr_t)(i) & 0xc0000000) == 0x80000000) | ||||
#define IN_CLASSB_NET 0xffff0000 | #define IN_CLASSB_NET 0xffff0000 | ||||
#define IN_CLASSB_NSHIFT 16 | #define IN_CLASSB_NSHIFT 16 | ||||
#define IN_CLASSB_HOST 0x0000ffff | #define IN_CLASSB_HOST 0x0000ffff | ||||
#define IN_CLASSB_MAX 65536 | #define IN_CLASSB_MAX 65536 | ||||
#define IN_CLASSC(i) (((in_addr_t)(i) & 0xe0000000) == 0xc0000000) | #define IN_CLASSC(i) (((in_addr_t)(i) & 0xe0000000) == 0xc0000000) | ||||
#define IN_CLASSC_NET 0xffffff00 | #define IN_CLASSC_NET 0xffffff00 | ||||
#define IN_CLASSC_NSHIFT 8 | #define IN_CLASSC_NSHIFT 8 | ||||
#define IN_CLASSC_HOST 0x000000ff | #define IN_CLASSC_HOST 0x000000ff | ||||
#endif /* IN_HISTORICAL_NETS */ | |||||
#define IN_CLASSD(i) (((in_addr_t)(i) & 0xf0000000) == 0xe0000000) | #define IN_NETMASK_DEFAULT 0xffffff00 /* mask when forced to guess */ | ||||
#define IN_MULTICAST(i) (((in_addr_t)(i) & 0xf0000000) == 0xe0000000) | |||||
#ifdef IN_HISTORICAL_NETS | |||||
#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. */ | ||||
#define IN_MULTICAST(i) IN_CLASSD(i) | #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) | ||||
#define IN_LINKLOCAL(i) (((in_addr_t)(i) & 0xffff0000) == 0xa9fe0000) | #define IN_LINKLOCAL(i) (((in_addr_t)(i) & 0xffff0000) == 0xa9fe0000) | ||||
#define IN_LOOPBACK(i) (((in_addr_t)(i) & 0xff000000) == 0x7f000000) | #define IN_LOOPBACK(i) (((in_addr_t)(i) & 0xff000000) == 0x7f000000) | ||||
#define IN_ZERONET(i) (((in_addr_t)(i) & 0xff000000) == 0) | #define IN_ZERONET(i) (((in_addr_t)(i) & 0xff000000) == 0) | ||||
Show All 14 Lines | |||||
#define INADDR_ALLHOSTS_GROUP ((in_addr_t)0xe0000001) /* 224.0.0.1 */ | #define INADDR_ALLHOSTS_GROUP ((in_addr_t)0xe0000001) /* 224.0.0.1 */ | ||||
#define INADDR_ALLRTRS_GROUP ((in_addr_t)0xe0000002) /* 224.0.0.2 */ | #define INADDR_ALLRTRS_GROUP ((in_addr_t)0xe0000002) /* 224.0.0.2 */ | ||||
#define INADDR_ALLRPTS_GROUP ((in_addr_t)0xe0000016) /* 224.0.0.22, IGMPv3 */ | #define INADDR_ALLRPTS_GROUP ((in_addr_t)0xe0000016) /* 224.0.0.22, IGMPv3 */ | ||||
#define INADDR_CARP_GROUP ((in_addr_t)0xe0000012) /* 224.0.0.18 */ | #define INADDR_CARP_GROUP ((in_addr_t)0xe0000012) /* 224.0.0.18 */ | ||||
#define INADDR_PFSYNC_GROUP ((in_addr_t)0xe00000f0) /* 224.0.0.240 */ | #define INADDR_PFSYNC_GROUP ((in_addr_t)0xe00000f0) /* 224.0.0.240 */ | ||||
#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 | |||||
#define IN_LOOPBACKNET 127 /* official! */ | #define IN_LOOPBACKNET 127 /* official! */ | ||||
#endif /* IN_HISTORICAL_NETS */ | |||||
#define IN_RFC3021_MASK ((in_addr_t)0xfffffffe) | #define IN_RFC3021_MASK ((in_addr_t)0xfffffffe) | ||||
/* | /* | ||||
* 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 */ | ||||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |