summaryrefslogtreecommitdiffstats
path: root/net.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-07 08:06:16 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-07 08:06:16 +0000
commitfa67273c1644551b50919fa7879acfdc92e269bc (patch)
tree38e41ee526a4bcc19540047c56c93b2a7865ef36 /net.h
parentae3e3e9cb1584b5cf7082c1b28c4cbbd48b1f664 (diff)
downloadrsyslog-fa67273c1644551b50919fa7879acfdc92e269bc.tar.gz
rsyslog-fa67273c1644551b50919fa7879acfdc92e269bc.tar.xz
rsyslog-fa67273c1644551b50919fa7879acfdc92e269bc.zip
- added RSYSLOGD_MODDIR environment variable
- added -M rsyslogd option (allows to specify module directory location) - converted net.c into a loadable library plugin
Diffstat (limited to 'net.h')
-rw-r--r--net.h70
1 files changed, 48 insertions, 22 deletions
diff --git a/net.h b/net.h
index e5844bf5..1916f3ed 100644
--- a/net.h
+++ b/net.h
@@ -35,9 +35,9 @@
#define ADDR_PRI6 0x02 /* use IPv6 address prior to IPv4 when resolving */
#ifdef BSD
-#ifndef _KERNEL
-#define s6_addr32 __u6_addr.__u6_addr32
-#endif
+# ifndef _KERNEL
+# define s6_addr32 __u6_addr.__u6_addr32
+# endif
#endif
struct NetAddr {
@@ -59,6 +59,20 @@ struct NetAddr {
# define SO_BSDCOMPAT 0
#endif
+
+/* IPv6 compatibility layer for older platforms
+ * We need to handle a few things different if we are running
+ * on an older platform which does not support all the glory
+ * of IPv6. We try to limit toll on features and reliability,
+ * but obviously it is better to run rsyslog on a platform that
+ * supports everything...
+ * rgerhards, 2007-06-22
+ */
+#ifndef AI_NUMERICSERV
+# define AI_NUMERICSERV 0
+#endif
+
+
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
#define SALEN(sa) ((sa)->sa_len)
#else
@@ -71,31 +85,43 @@ static inline size_t SALEN(struct sockaddr *sa) {
}
#endif
-rsRetVal cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN);
-/* things to go away after proper modularization */
-rsRetVal addAllowedSenderLine(char* pName, uchar** ppRestOfConfLine);
-void PrintAllowedSenders(int iListToPrint);
-void clearAllowedSenders ();
-void debugListenInfo(int fd, char *type);
-int *create_udp_socket(uchar *hostname, uchar *LogPort, int bIsServer);
-void closeUDPListenSockets(int *finet);
+struct AllowedSenders {
+ struct NetAddr allowedSender; /* ip address allowed */
+ uint8_t SignificantBits; /* defines how many bits should be discarded (eqiv to mask) */
+ struct AllowedSenders *pNext;
+};
+
+
+/* interfaces */
+BEGINinterface(net) /* name must also be changed in ENDinterface macro! */
+ rsRetVal (*cvthname)(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN);
+ /* things to go away after proper modularization */
+ rsRetVal (*addAllowedSenderLine)(char* pName, uchar** ppRestOfConfLine);
+ void (*PrintAllowedSenders)(int iListToPrint);
+ void (*clearAllowedSenders) ();
+ void (*debugListenInfo)(int fd, char *type);
+ int *(*create_udp_socket)(uchar *hostname, uchar *LogPort, int bIsServer);
+ void (*closeUDPListenSockets)(int *finet);
+ /* data memebers - these should go away over time... TODO */
+ int *pACLAddHostnameOnFail; /* add hostname to acl when DNS resolving has failed */
+ int *pACLDontResolve; /* add hostname to acl instead of resolving it to IP(s) */
+ struct AllowedSenders *pAllowedSenders_UDP;
+ struct AllowedSenders *pAllowedSenders_TCP;
+ struct AllowedSenders *pAllowedSenders_GSS;
+ENDinterface(net)
+#define netCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */
+
+/* prototypes */
+PROTOTYPEObj(net);
+
+
+#if 0
extern int ACLAddHostnameOnFail; /* add hostname to acl when DNS resolving has failed */
extern int ACLDontResolve; /* add hostname to acl instead of resolving it to IP(s) */
extern struct AllowedSenders *pAllowedSenders_UDP;
extern struct AllowedSenders *pAllowedSenders_TCP;
extern struct AllowedSenders *pAllowedSenders_GSS;
-
-/* IPv6 compatibility layer for older platforms
- * We need to handle a few things different if we are running
- * on an older platform which does not support all the glory
- * of IPv6. We try to limit toll on features and reliability,
- * but obviously it is better to run rsyslog on a platform that
- * supports everything...
- * rgerhards, 2007-06-22
- */
-#ifndef AI_NUMERICSERV
-# define AI_NUMERICSERV 0
#endif
#endif /* #ifdef SYSLOG_INET */