summaryrefslogtreecommitdiff
path: root/common/sock_any.h
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-07-20 16:41:51 +0000
committerStef Walter <stef@memberwebs.com>2004-07-20 16:41:51 +0000
commitb73a3b497ff95ebe012c31e4f778a6f776a734b1 (patch)
treeac8fc15515bf39563bd1eecc80e1642f7f1afd44 /common/sock_any.h
parent086da0b54d7f5711733febdb27507a5400767be6 (diff)
- Better connection handling
- Route connections without a IP back to incoming IP
Diffstat (limited to 'common/sock_any.h')
-rw-r--r--common/sock_any.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/common/sock_any.h b/common/sock_any.h
index 924bf09..0b492b4 100644
--- a/common/sock_any.h
+++ b/common/sock_any.h
@@ -64,7 +64,25 @@ struct sockaddr_any
#define SANY_LEN(any) ((any).namelen)
#define SANY_TYPE(any) ((any).s.a.sa_family)
-int sock_any_pton(const char* addr, struct sockaddr_any* any, int defport);
-int sock_any_ntop(struct sockaddr_any* any, char* addr, size_t addrlen);
+int sock_any_pton(const char* addr, struct sockaddr_any* any, int opts);
+
+/* The default port to fill in when no IP/IPv6 port specified */
+#define SANY_OPT_DEFPORT(p) (int)((p) & 0xFFFF)
+
+/* When only port specified default to IPANY */
+#define SANY_OPT_DEFANY 0x00000000
+
+/* When only port specified default to LOCALHOST */
+#define SANY_OPT_DEFLOCAL 0x00100000
+
+/* When only port specified default to IPv6 */
+#ifdef HAVE_INET6
+#define SANY_OPT_DEFINET6 0x00200000
+#endif
+
+int sock_any_ntop(struct sockaddr_any* any, char* addr, size_t addrlen, int opts);
+
+/* Don't print the port */
+#define SANY_OPT_NOPORT 0x01000000
#endif /* __SOCK_ANY_H__ */