mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 05:28:00 +00:00
add net.h; sockaddr.h and netaddr.h are now generic
This commit is contained in:
parent
283be780d8
commit
36d4a1b3bc
@ -19,7 +19,7 @@ top_srcdir = @top_srcdir@
|
||||
|
||||
@BIND9_VERSION@
|
||||
|
||||
HEADERS = app.h sockaddr.h time.h stdtime.h
|
||||
HEADERS = app.h net.h time.h stdtime.h
|
||||
|
||||
SUBDIRS =
|
||||
TARGETS =
|
||||
|
@ -15,30 +15,53 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef ISC_SOCKADDR_H
|
||||
#define ISC_SOCKADDR_H 1
|
||||
#ifndef ISC_NET_H
|
||||
#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 <isc/lang.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 */
|
||||
#endif /* ISC_NET_H */
|
@ -15,24 +15,53 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef ISC_NETADDR_H
|
||||
#define ISC_NETADDR_H 1
|
||||
#ifndef ISC_NET_H
|
||||
#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 <isc/lang.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 */
|
||||
#endif /* ISC_NET_H */
|
Loading…
x
Reference in New Issue
Block a user