Commit 36d4a1b3 authored by Bob Halley's avatar Bob Halley
Browse files

add net.h; sockaddr.h and netaddr.h are now generic

parent 283be780
......@@ -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
#include <netinet/in.h>
/*****
***** Module Info
*****/
#include <isc/lang.h>
/*
* 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
*/
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;
/***
*** Imports.
***/
isc_boolean_t
isc_sockaddr_equal(isc_sockaddr_t *, isc_sockaddr_t *);
#include <sys/types.h>
#include <sys/socket.h>
ISC_LANG_ENDDECLS
#include <netinet/in.h>
#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
#include <netinet/in.h>
/*****
***** Module Info
*****/
#include <isc/lang.h>
/*
* 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
*/
ISC_LANG_BEGINDECLS
typedef struct isc_netaddr {
union {
struct in_addr in;
#ifdef notyet
struct in6_addr in6;
#endif
} type;
} isc_netaddr_t;
/***
*** Imports.
***/
ISC_LANG_ENDDECLS
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#endif /* ISC_NETADDR_H */
#endif /* ISC_NET_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment