summaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
authorDenis Vlasenko2008-03-12 22:14:34 +0000
committerDenis Vlasenko2008-03-12 22:14:34 +0000
commit4e6d5117b839cef41cd3919966f95bf25d24d8d9 (patch)
tree277c292905fefcdf40530c8c29e87d6b8c5f7864 /include/libbb.h
parent4e6c8120a53709c4a352db42e997303844c74584 (diff)
downloadbusybox-4e6d5117b839cef41cd3919966f95bf25d24d8d9.zip
busybox-4e6d5117b839cef41cd3919966f95bf25d24d8d9.tar.gz
inetd: make it NOMMU-capable and IPv6-friendly. Lots of renames
of variable/function names Total: -2474 bytes text data bss dec hex filename 802215 661 7452 810328 c5d58 busybox_old 800120 661 7428 808209 c5511 busybox_unstripped
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 6e10cdc..3c53e5e 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -390,6 +390,7 @@ typedef struct len_and_sockaddr {
} u;
} len_and_sockaddr;
enum {
+ LSA_LEN_SIZE = offsetof(len_and_sockaddr, u),
LSA_SIZEOF_SA = sizeof(
union {
struct sockaddr sa;
@@ -405,7 +406,12 @@ enum {
* af == AF_UNSPEC will result in trying to create IPv6 socket,
* and if kernel doesn't support it, IPv4.
*/
-int xsocket_type(len_and_sockaddr **lsap, USE_FEATURE_IPV6(int af,) int sock_type);
+#if ENABLE_FEATURE_IPV6
+int xsocket_type(len_and_sockaddr **lsap, int af, int sock_type);
+#else
+int xsocket_type(len_and_sockaddr **lsap, int sock_type);
+#define xsocket_type(lsap, af, sock_type) xsocket_type((lsap), (sock_type))
+#endif
int xsocket_stream(len_and_sockaddr **lsap);
/* Create server socket bound to bindaddr:port. bindaddr can be NULL,
* numeric IP ("N.N.N.N") or numeric IPv6 address,
@@ -430,14 +436,13 @@ len_and_sockaddr* host2sockaddr(const char *host, int port);
/* Version which dies on error */
len_and_sockaddr* xhost2sockaddr(const char *host, int port);
len_and_sockaddr* xdotted2sockaddr(const char *host, int port);
-#if ENABLE_FEATURE_IPV6
/* Same, useful if you want to force family (e.g. IPv6) */
+#if !ENABLE_FEATURE_IPV6
+#define host_and_af2sockaddr(host, port, af) host2sockaddr((host), (port))
+#define xhost_and_af2sockaddr(host, port, af) xhost2sockaddr((host), (port))
+#else
len_and_sockaddr* host_and_af2sockaddr(const char *host, int port, sa_family_t af);
len_and_sockaddr* xhost_and_af2sockaddr(const char *host, int port, sa_family_t af);
-#else
-/* [we evaluate af: think about "host_and_af2sockaddr(..., af++)"] */
-#define host_and_af2sockaddr(host, port, af) ((void)(af), host2sockaddr((host), (port)))
-#define xhost_and_af2sockaddr(host, port, af) ((void)(af), xhost2sockaddr((host), (port)))
#endif
/* Assign sin[6]_port member if the socket is an AF_INET[6] one,
* otherwise no-op. Useful for ftp.