summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-03-11 18:55:59 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-03-11 18:55:59 +0100
commit54305181f6ee3af57dd3d15d53ea2e851b36ed23 (patch)
treea5aed631b68df033cba372f841d47a0cba5d7021 /lib
parente7b76b976084006e430543f4b872f624326dbfe6 (diff)
parentafa9f66c27e2f96b92059131def53cc7b2497705 (diff)
Merge branch 'new' into socket2
Diffstat (limited to 'lib')
-rw-r--r--lib/event.c3
-rw-r--r--lib/ip.h6
-rw-r--r--lib/ipv4.h2
-rw-r--r--lib/socket.h4
4 files changed, 12 insertions, 3 deletions
diff --git a/lib/event.c b/lib/event.c
index d556cd05..ce5e81c8 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -49,7 +49,8 @@ static struct resclass ev_class = {
"Event",
sizeof(event),
(void (*)(resource *)) ev_postpone,
- ev_dump
+ ev_dump,
+ NULL
};
/**
diff --git a/lib/ip.h b/lib/ip.h
index 1cc74e81..e9923e2f 100644
--- a/lib/ip.h
+++ b/lib/ip.h
@@ -46,10 +46,14 @@ char *ip_scope_text(unsigned);
struct prefix {
ip_addr addr;
- int len;
+ unsigned int len;
};
#define ip_is_prefix(a,l) (!ipa_nonzero(ipa_and(a, ipa_not(ipa_mkmask(l)))))
+#define ipa_zero(x) (!ipa_nonzero(x))
+
+static inline int ipa_classify_net(ip_addr a)
+{ return ipa_zero(a) ? (IADDR_HOST | SCOPE_UNIVERSE) : ipa_classify(a); }
/*
* Conversions between internal and string representation
diff --git a/lib/ipv4.h b/lib/ipv4.h
index 52bed16f..74f1e88f 100644
--- a/lib/ipv4.h
+++ b/lib/ipv4.h
@@ -72,7 +72,7 @@ int ipv4_classify(u32);
u32 ipv4_class_mask(u32);
byte *ipv4_skip_header(byte *, int *);
-static inline int ipv4_has_link_scope(u32 a)
+static inline int ipv4_has_link_scope(u32 a UNUSED)
{
return 0;
}
diff --git a/lib/socket.h b/lib/socket.h
index a21075e2..e6ce1257 100644
--- a/lib/socket.h
+++ b/lib/socket.h
@@ -9,6 +9,8 @@
#ifndef _BIRD_SOCKET_H_
#define _BIRD_SOCKET_H_
+#include <errno.h>
+
#include "lib/resource.h"
typedef struct birdsock {
@@ -67,6 +69,8 @@ int sk_leave_group(sock *s, ip_addr maddr);
int sk_set_ipv6_checksum(sock *s, int offset);
#endif
+int sk_set_broadcast(sock *s, int enable);
+
static inline int
sk_send_buffer_empty(sock *sk)
{