diff options
author | Ondrej Filip <feela@network.cz> | 2012-08-07 11:15:23 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2012-08-07 11:15:23 +0200 |
commit | 60c412b9368fd7c3b0a8df2200f02140adcb0cf3 (patch) | |
tree | 237d3c0b8aa86c6f3a88a76141ab51ca94b1fcd7 /lib | |
parent | 3fe1d9e4a40663b93b59f5b6f9d61af9dc6a8ae6 (diff) | |
parent | 94e2f1c111721d6213ea65cac5c53036e38e3973 (diff) |
Merge branch 'master' of ssh://git.nic.cz/birdv1.3.8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lists.h | 3 | ||||
-rw-r--r-- | lib/socket.h | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/lists.h b/lib/lists.h index 6fab12c4..0b0fdbe3 100644 --- a/lib/lists.h +++ b/lib/lists.h @@ -34,7 +34,8 @@ typedef struct list { /* In fact two overlayed nodes */ #define HEAD(list) ((void *)((list).head)) #define TAIL(list) ((void *)((list).tail)) #define NODE_NEXT(n) ((void *)((NODE (n))->next)) -#define WALK_LIST(n,list) for(n=HEAD(list);(NODE (n))->next; n=NODE_NEXT(n)) +#define NODE_VALID(n) ((NODE (n))->next) +#define WALK_LIST(n,list) for(n=HEAD(list); NODE_VALID(n); n=NODE_NEXT(n)) #define WALK_LIST_DELSAFE(n,nxt,list) \ for(n=HEAD(list); nxt=NODE_NEXT(n); n=(void *) nxt) /* WALK_LIST_FIRST supposes that called code removes each processed node */ diff --git a/lib/socket.h b/lib/socket.h index b0c3eda2..0ee43b52 100644 --- a/lib/socket.h +++ b/lib/socket.h @@ -48,7 +48,9 @@ typedef struct birdsock { char *password; /* Password for MD5 authentication */ } sock; -sock *sk_new(pool *); /* Allocate new socket */ +sock *sock_new(pool *); /* Allocate new socket */ +#define sk_new(X) sock_new(X) /* Wrapper to avoid name collision with OpenSSL */ + int sk_open(sock *); /* Open socket */ int sk_send(sock *, unsigned len); /* Send data, <0=err, >0=ok, 0=sleep */ int sk_send_to(sock *, unsigned len, ip_addr to, unsigned port); /* sk_send to given destination */ |