mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-06 01:25:44 +00:00
add net.h; sockaddr.h and netaddr.h are now generic
This commit is contained in:
@@ -19,7 +19,7 @@ top_srcdir = @top_srcdir@
|
|||||||
|
|
||||||
@BIND9_VERSION@
|
@BIND9_VERSION@
|
||||||
|
|
||||||
HEADERS = app.h sockaddr.h time.h stdtime.h
|
HEADERS = app.h net.h time.h stdtime.h
|
||||||
|
|
||||||
SUBDIRS =
|
SUBDIRS =
|
||||||
TARGETS =
|
TARGETS =
|
||||||
|
@@ -15,30 +15,53 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ISC_SOCKADDR_H
|
#ifndef ISC_NET_H
|
||||||
#define ISC_SOCKADDR_H 1
|
#define ISC_NET_H 1
|
||||||
|
|
||||||
|
/*****
|
||||||
|
***** Module Info
|
||||||
|
*****/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Basic Networking Types
|
||||||
|
*
|
||||||
|
* This module is responsible for defining the following basic networking
|
||||||
|
* types:
|
||||||
|
*
|
||||||
|
* struct in_addr
|
||||||
|
* struct in6_addr
|
||||||
|
* struct sockaddr
|
||||||
|
* struct sockaddr_in
|
||||||
|
* struct sockaddr_in6
|
||||||
|
*
|
||||||
|
* It ensures that the AF_ and PF_ macros are defined.
|
||||||
|
*
|
||||||
|
* It declares ntoh[sl]() and hton[sl]().
|
||||||
|
*
|
||||||
|
* MP:
|
||||||
|
* No impact.
|
||||||
|
*
|
||||||
|
* Reliability:
|
||||||
|
* No anticipated impact.
|
||||||
|
*
|
||||||
|
* Resources:
|
||||||
|
* N/A.
|
||||||
|
*
|
||||||
|
* Security:
|
||||||
|
* No anticipated impact.
|
||||||
|
*
|
||||||
|
* Standards:
|
||||||
|
* BSD Socket API
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
*** Imports.
|
||||||
|
***/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
#include <isc/lang.h>
|
#endif /* ISC_NET_H */
|
||||||
|
|
||||||
ISC_LANG_BEGINDECLS
|
|
||||||
|
|
||||||
typedef struct isc_sockaddr {
|
|
||||||
/*
|
|
||||||
* XXX Must be big enough for all sockaddr types we care about.
|
|
||||||
*/
|
|
||||||
union {
|
|
||||||
struct sockaddr_in sin;
|
|
||||||
#ifdef notyet
|
|
||||||
struct sockaddr_in6 sin6;
|
|
||||||
#endif
|
|
||||||
} type;
|
|
||||||
} isc_sockaddr_t;
|
|
||||||
|
|
||||||
isc_boolean_t
|
|
||||||
isc_sockaddr_equal(isc_sockaddr_t *, isc_sockaddr_t *);
|
|
||||||
|
|
||||||
ISC_LANG_ENDDECLS
|
|
||||||
|
|
||||||
#endif /* ISC_SOCKADDR_H */
|
|
@@ -15,24 +15,53 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ISC_NETADDR_H
|
#ifndef ISC_NET_H
|
||||||
#define ISC_NETADDR_H 1
|
#define ISC_NET_H 1
|
||||||
|
|
||||||
|
/*****
|
||||||
|
***** Module Info
|
||||||
|
*****/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Basic Networking Types
|
||||||
|
*
|
||||||
|
* This module is responsible for defining the following basic networking
|
||||||
|
* types:
|
||||||
|
*
|
||||||
|
* struct in_addr
|
||||||
|
* struct in6_addr
|
||||||
|
* struct sockaddr
|
||||||
|
* struct sockaddr_in
|
||||||
|
* struct sockaddr_in6
|
||||||
|
*
|
||||||
|
* It ensures that the AF_ and PF_ macros are defined.
|
||||||
|
*
|
||||||
|
* It declares ntoh[sl]() and hton[sl]().
|
||||||
|
*
|
||||||
|
* MP:
|
||||||
|
* No impact.
|
||||||
|
*
|
||||||
|
* Reliability:
|
||||||
|
* No anticipated impact.
|
||||||
|
*
|
||||||
|
* Resources:
|
||||||
|
* N/A.
|
||||||
|
*
|
||||||
|
* Security:
|
||||||
|
* No anticipated impact.
|
||||||
|
*
|
||||||
|
* Standards:
|
||||||
|
* BSD Socket API
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
*** Imports.
|
||||||
|
***/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
#include <isc/lang.h>
|
#endif /* ISC_NET_H */
|
||||||
|
|
||||||
ISC_LANG_BEGINDECLS
|
|
||||||
|
|
||||||
typedef struct isc_netaddr {
|
|
||||||
union {
|
|
||||||
struct in_addr in;
|
|
||||||
#ifdef notyet
|
|
||||||
struct in6_addr in6;
|
|
||||||
#endif
|
|
||||||
} type;
|
|
||||||
} isc_netaddr_t;
|
|
||||||
|
|
||||||
ISC_LANG_ENDDECLS
|
|
||||||
|
|
||||||
#endif /* ISC_NETADDR_H */
|
|
Reference in New Issue
Block a user