summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bitops.c2
-rw-r--r--lib/bitops.h2
-rw-r--r--lib/checksum.c10
-rw-r--r--lib/checksum.h4
-rw-r--r--lib/ip.h4
-rw-r--r--lib/mempool.c12
-rw-r--r--lib/printf.c2
-rw-r--r--lib/slab.c12
-rw-r--r--lib/socket.h14
-rw-r--r--lib/xmalloc.c4
10 files changed, 33 insertions, 33 deletions
diff --git a/lib/bitops.c b/lib/bitops.c
index b63274b8..81586e87 100644
--- a/lib/bitops.c
+++ b/lib/bitops.c
@@ -17,7 +17,7 @@
* representation consists of @n ones followed by zeroes.
*/
u32
-u32_mkmask(unsigned n)
+u32_mkmask(uint n)
{
return n ? ~((1 << (32 - n)) - 1) : 0;
}
diff --git a/lib/bitops.h b/lib/bitops.h
index a12f6b60..c0ad1a70 100644
--- a/lib/bitops.h
+++ b/lib/bitops.h
@@ -18,7 +18,7 @@
* u32_masklen Inverse operation to u32_mkmask, -1 if not a bitmask.
*/
-u32 u32_mkmask(unsigned n);
+u32 u32_mkmask(uint n);
int u32_masklen(u32 x);
u32 u32_log2(u32 v);
diff --git a/lib/checksum.c b/lib/checksum.c
index 18b1f92c..b61306b3 100644
--- a/lib/checksum.c
+++ b/lib/checksum.c
@@ -28,7 +28,7 @@ add32(u32 sum, u32 x)
}
static u16
-ipsum_calc_block(u32 *buf, unsigned len, u16 isum)
+ipsum_calc_block(u32 *buf, uint len, u16 isum)
{
/*
* A few simple facts about the IP checksum (see RFC 1071 for detailed
@@ -57,7 +57,7 @@ ipsum_calc_block(u32 *buf, unsigned len, u16 isum)
}
static u16
-ipsum_calc(void *frag, unsigned len, va_list args)
+ipsum_calc(void *frag, uint len, va_list args)
{
u16 sum = 0;
@@ -67,7 +67,7 @@ ipsum_calc(void *frag, unsigned len, va_list args)
frag = va_arg(args, void *);
if (!frag)
break;
- len = va_arg(args, unsigned);
+ len = va_arg(args, uint);
}
return sum;
}
@@ -87,7 +87,7 @@ ipsum_calc(void *frag, unsigned len, va_list args)
* Result: 1 if the checksum is correct, 0 else.
*/
int
-ipsum_verify(void *frag, unsigned len, ...)
+ipsum_verify(void *frag, uint len, ...)
{
va_list args;
u16 sum;
@@ -110,7 +110,7 @@ ipsum_verify(void *frag, unsigned len, ...)
* up checksum calculation as much as possible.
*/
u16
-ipsum_calculate(void *frag, unsigned len, ...)
+ipsum_calculate(void *frag, uint len, ...)
{
va_list args;
u16 sum;
diff --git a/lib/checksum.h b/lib/checksum.h
index 81515543..16cbcce5 100644
--- a/lib/checksum.h
+++ b/lib/checksum.h
@@ -14,7 +14,7 @@
* fragments finished by NULL pointer.
*/
-int ipsum_verify(void *frag, unsigned len, ...);
-u16 ipsum_calculate(void *frag, unsigned len, ...);
+int ipsum_verify(void *frag, uint len, ...);
+u16 ipsum_calculate(void *frag, uint len, ...);
#endif
diff --git a/lib/ip.h b/lib/ip.h
index 45e073d9..90bb7f8a 100644
--- a/lib/ip.h
+++ b/lib/ip.h
@@ -471,11 +471,11 @@ int ip6_pton(char *a, ip6_addr *o);
#define ipa_in_net(x,n,p) (ipa_zero(ipa_and(ipa_xor((n),(x)),ipa_mkmask(p))))
#define net_in_net(n1,l1,n2,l2) (((l1) >= (l2)) && (ipa_zero(ipa_and(ipa_xor((n1),(n2)),ipa_mkmask(l2)))))
-char *ip_scope_text(unsigned);
+char *ip_scope_text(uint);
struct prefix {
ip_addr addr;
- unsigned int len;
+ uint len;
};
diff --git a/lib/mempool.c b/lib/mempool.c
index ec9854a9..a8281041 100644
--- a/lib/mempool.c
+++ b/lib/mempool.c
@@ -27,7 +27,7 @@
struct lp_chunk {
struct lp_chunk *next;
- unsigned int size;
+ uint size;
uintptr_t data_align[0];
byte data[0];
};
@@ -37,7 +37,7 @@ struct linpool {
byte *ptr, *end;
struct lp_chunk *first, *current, **plast; /* Normal (reusable) chunks */
struct lp_chunk *first_large; /* Large chunks */
- unsigned chunk_size, threshold, total, total_large;
+ uint chunk_size, threshold, total, total_large;
};
static void lp_free(resource *);
@@ -64,7 +64,7 @@ static struct resclass lp_class = {
* @blk.
*/
linpool
-*lp_new(pool *p, unsigned blk)
+*lp_new(pool *p, uint blk)
{
linpool *m = ralloc(p, &lp_class);
m->plast = &m->first;
@@ -88,7 +88,7 @@ linpool
* size chunk, an "overflow" chunk is created for it instead.
*/
void *
-lp_alloc(linpool *m, unsigned size)
+lp_alloc(linpool *m, uint size)
{
byte *a = (byte *) BIRD_ALIGN((unsigned long) m->ptr, CPU_STRUCT_ALIGN);
byte *e = a + size;
@@ -146,7 +146,7 @@ lp_alloc(linpool *m, unsigned size)
* how to allocate strings without any space overhead.
*/
void *
-lp_allocu(linpool *m, unsigned size)
+lp_allocu(linpool *m, uint size)
{
byte *a = m->ptr;
byte *e = a + size;
@@ -168,7 +168,7 @@ lp_allocu(linpool *m, unsigned size)
* clears the allocated memory block.
*/
void *
-lp_allocz(linpool *m, unsigned size)
+lp_allocz(linpool *m, uint size)
{
void *z = lp_alloc(m, size);
diff --git a/lib/printf.c b/lib/printf.c
index a1c36129..e4cc3006 100644
--- a/lib/printf.c
+++ b/lib/printf.c
@@ -355,7 +355,7 @@ int bvsnprintf(char *buf, int size, const char *fmt, va_list args)
} else if (flags & SIGN)
num = va_arg(args, int);
else
- num = va_arg(args, unsigned int);
+ num = va_arg(args, uint);
str = number(str, num, base, field_width, precision, flags, size);
if (!str)
return -1;
diff --git a/lib/slab.c b/lib/slab.c
index 31529c30..5c414f9e 100644
--- a/lib/slab.c
+++ b/lib/slab.c
@@ -51,7 +51,7 @@ static size_t slab_memsize(resource *r);
struct slab {
resource r;
- unsigned size;
+ uint size;
list objs;
};
@@ -71,7 +71,7 @@ struct sl_obj {
};
slab *
-sl_new(pool *p, unsigned size)
+sl_new(pool *p, uint size)
{
slab *s = ralloc(p, &sl_class);
s->size = size;
@@ -144,7 +144,7 @@ slab_memsize(resource *r)
struct slab {
resource r;
- unsigned obj_size, head_size, objs_per_slab, num_empty_heads, data_size;
+ uint obj_size, head_size, objs_per_slab, num_empty_heads, data_size;
list empty_heads, partial_heads, full_heads;
};
@@ -185,10 +185,10 @@ struct sl_alignment { /* Magic structure for testing of alignment */
* objects of size @size can be allocated.
*/
slab *
-sl_new(pool *p, unsigned size)
+sl_new(pool *p, uint size)
{
slab *s = ralloc(p, &sl_class);
- unsigned int align = sizeof(struct sl_alignment);
+ uint align = sizeof(struct sl_alignment);
if (align < sizeof(int))
align = sizeof(int);
s->data_size = size;
@@ -214,7 +214,7 @@ sl_new_head(slab *s)
struct sl_head *h = xmalloc(SLAB_SIZE);
struct sl_obj *o = (struct sl_obj *)((byte *)h+s->head_size);
struct sl_obj *no;
- unsigned int n = s->objs_per_slab;
+ uint n = s->objs_per_slab;
h->first_free = o;
h->num_full = 0;
diff --git a/lib/socket.h b/lib/socket.h
index 683cdde3..fbea92aa 100644
--- a/lib/socket.h
+++ b/lib/socket.h
@@ -20,7 +20,7 @@ typedef struct birdsock {
int type; /* Socket type */
void *data; /* User data */
ip_addr saddr, daddr; /* IPA_NONE = unspecified */
- unsigned sport, dport; /* 0 = unspecified (for IP: protocol type) */
+ uint sport, dport; /* 0 = unspecified (for IP: protocol type) */
int tos; /* TOS / traffic class, -1 = default */
int priority; /* Local socket priority, -1 = default */
int ttl; /* Time To Live, -1 = default */
@@ -28,20 +28,20 @@ typedef struct birdsock {
struct iface *iface; /* Interface; specify this for broad/multicast sockets */
byte *rbuf, *rpos; /* NULL=allocate automatically */
- unsigned rbsize;
+ uint rbsize;
int (*rx_hook)(struct birdsock *, int size); /* NULL=receiving turned off, returns 1 to clear rx buffer */
byte *tbuf, *tpos; /* NULL=allocate automatically */
byte *ttx; /* Internal */
- unsigned tbsize;
+ uint tbsize;
void (*tx_hook)(struct birdsock *);
void (*err_hook)(struct birdsock *, int); /* errno or zero if EOF */
/* Information about received datagrams (UDP, RAW), valid in rx_hook */
ip_addr faddr, laddr; /* src (From) and dst (Local) address of the datagram */
- unsigned fport; /* src port of the datagram */
- unsigned lifindex; /* local interface that received the datagram */
+ uint fport; /* src port of the datagram */
+ uint lifindex; /* local interface that received the datagram */
/* laddr and lifindex are valid only if SKF_LADDR_RX flag is set to request it */
int af; /* Address family (AF_INET, AF_INET6 or 0 for non-IP) of fd */
@@ -59,8 +59,8 @@ sock *sock_new(pool *); /* Allocate new socket */
int sk_open(sock *); /* Open socket */
int sk_rx_ready(sock *s);
-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 */
+int sk_send(sock *, uint len); /* Send data, <0=err, >0=ok, 0=sleep */
+int sk_send_to(sock *, uint len, ip_addr to, uint port); /* sk_send to given destination */
void sk_reallocate(sock *); /* Free and allocate tbuf & rbuf */
void sk_set_rbsize(sock *s, uint val); /* Resize RX buffer */
void sk_set_tbsize(sock *s, uint val); /* Resize TX buffer, keeping content */
diff --git a/lib/xmalloc.c b/lib/xmalloc.c
index da2f0941..10bf28cf 100644
--- a/lib/xmalloc.c
+++ b/lib/xmalloc.c
@@ -24,7 +24,7 @@
* Wherever possible, please use the memory resources instead.
*/
void *
-xmalloc(unsigned size)
+xmalloc(uint size)
{
void *p = malloc(size);
if (p)
@@ -44,7 +44,7 @@ xmalloc(unsigned size)
* Wherever possible, please use the memory resources instead.
*/
void *
-xrealloc(void *ptr, unsigned size)
+xrealloc(void *ptr, uint size)
{
void *p = realloc(ptr, size);
if (p)