diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-11-01 22:48:25 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:11 -0500 |
commit | 284349482f5293a9a23d0f72d7c2aab46b55843b (patch) | |
tree | 6f96931afb18ea841983a2895b62c97fed9f77b7 /source4/lib/socket | |
parent | 9f14afa12c11d02a49f4f310c3f8d834ce8a835d (diff) | |
download | samba-284349482f5293a9a23d0f72d7c2aab46b55843b.tar.gz samba-284349482f5293a9a23d0f72d7c2aab46b55843b.tar.bz2 samba-284349482f5293a9a23d0f72d7c2aab46b55843b.zip |
r3443: the next stage in the include files re-organisation.
I have created the include/system/ directory, which will contain the
wrappers for the system includes for logical subsystems. So far I have
created include/system/kerberos.h and include/system/network.h, which
contain all the system includes for kerberos code and networking code.
These are the included in subsystems that need kerberos or networking
respectively.
Note that this method avoids the mess of #ifdef HAVE_XXX_H in every C
file, instead each C module includes the include/system/XXX.h file for
the logical system support it needs, and the details are kept isolated
in include/system/
This patch also creates a "struct ipv4_addr" which replaces "struct
in_addr" in our code. That avoids every C file needing to import all
the system networking headers.
(This used to be commit 2e25c71853f8996f73755277e448e7d670810349)
Diffstat (limited to 'source4/lib/socket')
-rw-r--r-- | source4/lib/socket/access.c | 1 | ||||
-rw-r--r-- | source4/lib/socket/socket_ipv4.c | 13 | ||||
-rw-r--r-- | source4/lib/socket/socket_ipv6.c | 1 |
3 files changed, 9 insertions, 6 deletions
diff --git a/source4/lib/socket/access.c b/source4/lib/socket/access.c index f33f8d56b1..f5093177dd 100644 --- a/source4/lib/socket/access.c +++ b/source4/lib/socket/access.c @@ -32,6 +32,7 @@ */ #include "includes.h" +#include "system/network.h" #define FAIL (-1) #define ALLONES ((uint32_t)0xFFFFFFFF) diff --git a/source4/lib/socket/socket_ipv4.c b/source4/lib/socket/socket_ipv4.c index f9318a29bb..9777705419 100644 --- a/source4/lib/socket/socket_ipv4.c +++ b/source4/lib/socket/socket_ipv4.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "system/network.h" static NTSTATUS ipv4_tcp_init(struct socket_context *sock) { @@ -41,8 +42,8 @@ static NTSTATUS ipv4_tcp_connect(struct socket_context *sock, uint32_t flags) { struct sockaddr_in srv_addr; - struct in_addr my_ip; - struct in_addr srv_ip; + struct ipv4_addr my_ip; + struct ipv4_addr srv_ip; int ret; my_ip = interpret_addr2(my_address); @@ -53,7 +54,7 @@ static NTSTATUS ipv4_tcp_connect(struct socket_context *sock, #ifdef HAVE_SOCK_SIN_LEN my_addr.sin_len = sizeof(my_addr); #endif - my_addr.sin_addr = my_ip; + my_addr.sin_addr.s_addr = my_ip.s_addr; my_addr.sin_port = htons(my_port); my_addr.sin_family = PF_INET; @@ -69,7 +70,7 @@ static NTSTATUS ipv4_tcp_connect(struct socket_context *sock, #ifdef HAVE_SOCK_SIN_LEN srv_addr.sin_len = sizeof(srv_addr); #endif - srv_addr.sin_addr = srv_ip; + srv_addr.sin_addr.s_addr= srv_ip.s_addr; srv_addr.sin_port = htons(srv_port); srv_addr.sin_family = PF_INET; @@ -95,7 +96,7 @@ static NTSTATUS ipv4_tcp_listen(struct socket_context *sock, int queue_size, uint32_t flags) { struct sockaddr_in my_addr; - struct in_addr ip_addr; + struct ipv4_addr ip_addr; int ret; ip_addr = interpret_addr2(my_address); @@ -104,7 +105,7 @@ static NTSTATUS ipv4_tcp_listen(struct socket_context *sock, #ifdef HAVE_SOCK_SIN_LEN my_addr.sin_len = sizeof(my_addr); #endif - my_addr.sin_addr = ip_addr; + my_addr.sin_addr.s_addr = ip_addr.s_addr; my_addr.sin_port = htons(port); my_addr.sin_family = PF_INET; diff --git a/source4/lib/socket/socket_ipv6.c b/source4/lib/socket/socket_ipv6.c index 268212dcca..75e6fcab5c 100644 --- a/source4/lib/socket/socket_ipv6.c +++ b/source4/lib/socket/socket_ipv6.c @@ -20,6 +20,7 @@ */ #include "includes.h" +#include "system/network.h" static struct in6_addr interpret_addr6(const char *name) { |