Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in.h
Show First 20 Lines • Show All 690 Lines • ▼ Show 20 Lines | |||||
#define in_hosteq(s, t) ((s).s_addr == (t).s_addr) | #define in_hosteq(s, t) ((s).s_addr == (t).s_addr) | ||||
#define in_nullhost(x) ((x).s_addr == INADDR_ANY) | #define in_nullhost(x) ((x).s_addr == INADDR_ANY) | ||||
#define in_allhosts(x) ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP)) | #define in_allhosts(x) ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP)) | ||||
#define satosin(sa) ((struct sockaddr_in *)(sa)) | #define satosin(sa) ((struct sockaddr_in *)(sa)) | ||||
#define sintosa(sin) ((struct sockaddr *)(sin)) | #define sintosa(sin) ((struct sockaddr *)(sin)) | ||||
#define ifatoia(ifa) ((struct in_ifaddr *)(ifa)) | #define ifatoia(ifa) ((struct in_ifaddr *)(ifa)) | ||||
typedef int ipproto_input_t(struct mbuf **, int *, int); | |||||
typedef void ipproto_ctlinput_t(int, struct sockaddr *, void *); | |||||
int ipproto_register(uint8_t, ipproto_input_t, ipproto_ctlinput_t); | |||||
int ipproto_unregister(uint8_t); | |||||
int ip6proto_register(uint8_t, ipproto_input_t, ipproto_ctlinput_t); | |||||
int ip6proto_unregister(uint8_t); | |||||
#define IPPROTO_REGISTER(prot, input, ctl) do { \ | |||||
int error __diagused; \ | |||||
error = ipproto_register(prot, input, ctl); \ | |||||
MPASS(error == 0); \ | |||||
melifaro: Q: why can't it be embedded in the functions itself, so we don't use these macros? | |||||
} while (0) | |||||
#define IP6PROTO_REGISTER(prot, input, ctl) do { \ | |||||
int error __diagused; \ | |||||
error = ip6proto_register(prot, input, ctl); \ | |||||
MPASS(error == 0); \ | |||||
} while (0) | |||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
/* INET6 stuff */ | /* INET6 stuff */ | ||||
#if __POSIX_VISIBLE >= 200112 | #if __POSIX_VISIBLE >= 200112 | ||||
#define __KAME_NETINET_IN_H_INCLUDED_ | #define __KAME_NETINET_IN_H_INCLUDED_ | ||||
#include <netinet6/in6.h> | #include <netinet6/in6.h> | ||||
#undef __KAME_NETINET_IN_H_INCLUDED_ | #undef __KAME_NETINET_IN_H_INCLUDED_ | ||||
#endif | #endif | ||||
#endif /* !_NETINET_IN_H_*/ | #endif /* !_NETINET_IN_H_*/ |
Q: why can't it be embedded in the functions itself, so we don't use these macros?