Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BIRD Internet Routing Daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
labs
BIRD Internet Routing Daemon
Commits
ae80a2de
Commit
ae80a2de
authored
May 19, 2015
by
Pavel Tvrdík
Committed by
Ondřej Zajíček
Jun 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unsigned [int] -> uint
parent
e348ef01
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
134 additions
and
134 deletions
+134
-134
client/commands.c
client/commands.c
+1
-1
conf/conf.h
conf/conf.h
+1
-1
lib/bitops.c
lib/bitops.c
+1
-1
lib/bitops.h
lib/bitops.h
+1
-1
lib/checksum.c
lib/checksum.c
+5
-5
lib/checksum.h
lib/checksum.h
+2
-2
lib/ip.h
lib/ip.h
+2
-2
lib/mempool.c
lib/mempool.c
+6
-6
lib/printf.c
lib/printf.c
+1
-1
lib/slab.c
lib/slab.c
+6
-6
lib/socket.h
lib/socket.h
+7
-7
lib/xmalloc.c
lib/xmalloc.c
+2
-2
misc/ips.c
misc/ips.c
+2
-2
nest/a-path.c
nest/a-path.c
+1
-1
nest/a-set.c
nest/a-set.c
+2
-2
nest/attrs.h
nest/attrs.h
+3
-3
nest/cli.c
nest/cli.c
+5
-5
nest/cli.h
nest/cli.h
+6
-6
nest/neighbor.c
nest/neighbor.c
+2
-2
nest/proto.c
nest/proto.c
+11
-11
nest/protocol.h
nest/protocol.h
+9
-9
nest/route.h
nest/route.h
+11
-11
nest/rt-attr.c
nest/rt-attr.c
+15
-15
nest/rt-fib.c
nest/rt-fib.c
+5
-5
nest/rt-table.c
nest/rt-table.c
+5
-5
proto/bgp/attrs.c
proto/bgp/attrs.c
+7
-7
proto/bgp/bgp.h
proto/bgp/bgp.h
+4
-4
proto/bgp/packets.c
proto/bgp/packets.c
+4
-4
sysdep/bsd/krt-sock.c
sysdep/bsd/krt-sock.c
+2
-2
sysdep/linux/netlink.c
sysdep/linux/netlink.c
+3
-3
sysdep/unix/main.c
sysdep/unix/main.c
+1
-1
sysdep/unix/unix.h
sysdep/unix/unix.h
+1
-1
No files found.
client/commands.c
View file @
ae80a2de
...
...
@@ -38,7 +38,7 @@ static struct cmd_node cmd_root;
void
cmd_build_tree
(
void
)
{
u
nsigned
int
i
;
uint
i
;
cmd_root
.
plastson
=
&
cmd_root
.
son
;
...
...
conf/conf.h
View file @
ae80a2de
...
...
@@ -100,7 +100,7 @@ void cfg_copy_list(list *dest, list *src, unsigned node_size);
/* Lexer */
extern
int
(
*
cf_read_hook
)(
byte
*
buf
,
u
nsigned
int
max
,
int
fd
);
extern
int
(
*
cf_read_hook
)(
byte
*
buf
,
uint
max
,
int
fd
);
struct
symbol
{
struct
symbol
*
next
;
...
...
lib/bitops.c
View file @
ae80a2de
...
...
@@ -17,7 +17,7 @@
* representation consists of @n ones followed by zeroes.
*/
u32
u32_mkmask
(
u
nsigned
n
)
u32_mkmask
(
u
int
n
)
{
return
n
?
~
((
1
<<
(
32
-
n
))
-
1
)
:
0
;
}
...
...
lib/bitops.h
View file @
ae80a2de
...
...
@@ -18,7 +18,7 @@
* u32_masklen Inverse operation to u32_mkmask, -1 if not a bitmask.
*/
u32
u32_mkmask
(
u
nsigned
n
);
u32
u32_mkmask
(
u
int
n
);
int
u32_masklen
(
u32
x
);
u32
u32_log2
(
u32
v
);
...
...
lib/checksum.c
View file @
ae80a2de
...
...
@@ -28,7 +28,7 @@ add32(u32 sum, u32 x)
}
static
u16
ipsum_calc_block
(
u32
*
buf
,
u
nsigned
len
,
u16
isum
)
ipsum_calc_block
(
u32
*
buf
,
u
int
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
,
u
nsigned
len
,
va_list
args
)
ipsum_calc
(
void
*
frag
,
u
int
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
,
u
nsigned
);
len
=
va_arg
(
args
,
u
int
);
}
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
,
u
nsigned
len
,
...)
ipsum_verify
(
void
*
frag
,
u
int
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
,
u
nsigned
len
,
...)
ipsum_calculate
(
void
*
frag
,
u
int
len
,
...)
{
va_list
args
;
u16
sum
;
...
...
lib/checksum.h
View file @
ae80a2de
...
...
@@ -14,7 +14,7 @@
* fragments finished by NULL pointer.
*/
int
ipsum_verify
(
void
*
frag
,
u
nsigned
len
,
...);
u16
ipsum_calculate
(
void
*
frag
,
u
nsigned
len
,
...);
int
ipsum_verify
(
void
*
frag
,
u
int
len
,
...);
u16
ipsum_calculate
(
void
*
frag
,
u
int
len
,
...);
#endif
lib/ip.h
View file @
ae80a2de
...
...
@@ -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
(
u
nsigned
);
char
*
ip_scope_text
(
u
int
);
struct
prefix
{
ip_addr
addr
;
u
nsigned
int
len
;
uint
len
;
};
...
...
lib/mempool.c
View file @
ae80a2de
...
...
@@ -27,7 +27,7 @@
struct
lp_chunk
{
struct
lp_chunk
*
next
;
u
nsigned
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 */
u
nsigned
chunk_size
,
threshold
,
total
,
total_large
;
u
int
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
,
u
nsigned
blk
)
*
lp_new
(
pool
*
p
,
u
int
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
,
u
nsigned
size
)
lp_alloc
(
linpool
*
m
,
u
int
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
,
u
nsigned
size
)
lp_allocu
(
linpool
*
m
,
u
int
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
,
u
nsigned
size
)
lp_allocz
(
linpool
*
m
,
u
int
size
)
{
void
*
z
=
lp_alloc
(
m
,
size
);
...
...
lib/printf.c
View file @
ae80a2de
...
...
@@ -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
,
u
nsigned
int
);
num
=
va_arg
(
args
,
uint
);
str
=
number
(
str
,
num
,
base
,
field_width
,
precision
,
flags
,
size
);
if
(
!
str
)
return
-
1
;
...
...
lib/slab.c
View file @
ae80a2de
...
...
@@ -51,7 +51,7 @@ static size_t slab_memsize(resource *r);
struct
slab
{
resource
r
;
u
nsigned
size
;
u
int
size
;
list
objs
;
};
...
...
@@ -71,7 +71,7 @@ struct sl_obj {
};
slab
*
sl_new
(
pool
*
p
,
u
nsigned
size
)
sl_new
(
pool
*
p
,
u
int
size
)
{
slab
*
s
=
ralloc
(
p
,
&
sl_class
);
s
->
size
=
size
;
...
...
@@ -144,7 +144,7 @@ slab_memsize(resource *r)
struct
slab
{
resource
r
;
u
nsigned
obj_size
,
head_size
,
objs_per_slab
,
num_empty_heads
,
data_size
;
u
int
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
,
u
nsigned
size
)
sl_new
(
pool
*
p
,
u
int
size
)
{
slab
*
s
=
ralloc
(
p
,
&
sl_class
);
u
nsigned
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
;
u
nsigned
int
n
=
s
->
objs_per_slab
;
uint
n
=
s
->
objs_per_slab
;
h
->
first_free
=
o
;
h
->
num_full
=
0
;
...
...
lib/socket.h
View file @
ae80a2de
...
...
@@ -20,7 +20,7 @@ typedef struct birdsock {
int
type
;
/* Socket type */
void
*
data
;
/* User data */
ip_addr
saddr
,
daddr
;
/* IPA_NONE = unspecified */
u
nsigned
sport
,
dport
;
/* 0 = unspecified (for IP: protocol type) */
u
int
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 */
u
nsigned
rbsize
;
u
int
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 */
u
nsigned
tbsize
;
u
int
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 */
u
nsigned
fport
;
/* src port of the datagram */
u
nsigned
lifindex
;
/* local interface that received the datagram */
u
int
fport
;
/* src port of the datagram */
u
int
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
*
,
u
nsigned
len
);
/* Send data, <0=err, >0=ok, 0=sleep */
int
sk_send_to
(
sock
*
,
u
nsigned
len
,
ip_addr
to
,
unsigned
port
);
/* sk_send to given destination */
int
sk_send
(
sock
*
,
u
int
len
);
/* Send data, <0=err, >0=ok, 0=sleep */
int
sk_send_to
(
sock
*
,
u
int
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 */
...
...
lib/xmalloc.c
View file @
ae80a2de
...
...
@@ -24,7 +24,7 @@
* Wherever possible, please use the memory resources instead.
*/
void
*
xmalloc
(
u
nsigned
size
)
xmalloc
(
u
int
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
,
u
nsigned
size
)
xrealloc
(
void
*
ptr
,
u
int
size
)
{
void
*
p
=
realloc
(
ptr
,
size
);
if
(
p
)
...
...
misc/ips.c
View file @
ae80a2de
...
...
@@ -23,7 +23,7 @@ int h[65536];
* = ((1-1/k)^k)^a which we can approximate by e^-a.
*/
u
nsigned
int
hf
(
unsigned
int
n
)
u
int
hf
(
u
int
n
)
{
#if 0
n = (n ^ (n >> 16)) & 0xffff;
...
...
@@ -58,7 +58,7 @@ main(int argc, char **argv)
while
(
max
--
)
{
u
nsigned
int
i
,
e
;
uint
i
,
e
;
if
(
scanf
(
"%x/%d"
,
&
i
,
&
e
)
!=
2
)
if
(
feof
(
stdin
))
break
;
...
...
nest/a-path.c
View file @
ae80a2de
...
...
@@ -124,7 +124,7 @@ as_path_convert_to_new(struct adata *path, byte *dst, int req_as)
}
void
as_path_format
(
struct
adata
*
path
,
byte
*
buf
,
u
nsigned
int
size
)
as_path_format
(
struct
adata
*
path
,
byte
*
buf
,
uint
size
)
{
byte
*
p
=
path
->
data
;
byte
*
e
=
p
+
path
->
length
;
...
...
nest/a-set.c
View file @
ae80a2de
...
...
@@ -32,7 +32,7 @@
* the buffer to indicate truncation.
*/
int
int_set_format
(
struct
adata
*
set
,
int
way
,
int
from
,
byte
*
buf
,
u
nsigned
int
size
)
int_set_format
(
struct
adata
*
set
,
int
way
,
int
from
,
byte
*
buf
,
uint
size
)
{
u32
*
z
=
(
u32
*
)
set
->
data
;
byte
*
end
=
buf
+
size
-
24
;
...
...
@@ -113,7 +113,7 @@ ec_format(byte *buf, u64 ec)
}
int
ec_set_format
(
struct
adata
*
set
,
int
from
,
byte
*
buf
,
u
nsigned
int
size
)
ec_set_format
(
struct
adata
*
set
,
int
from
,
byte
*
buf
,
uint
size
)
{
u32
*
z
=
int_set_get_data
(
set
);
byte
*
end
=
buf
+
size
-
24
;
...
...
nest/attrs.h
View file @
ae80a2de
...
...
@@ -30,7 +30,7 @@ struct f_tree;
struct
adata
*
as_path_prepend
(
struct
linpool
*
pool
,
struct
adata
*
olda
,
u32
as
);
int
as_path_convert_to_old
(
struct
adata
*
path
,
byte
*
dst
,
int
*
new_used
);
int
as_path_convert_to_new
(
struct
adata
*
path
,
byte
*
dst
,
int
req_as
);
void
as_path_format
(
struct
adata
*
path
,
byte
*
buf
,
u
nsigned
int
size
);
void
as_path_format
(
struct
adata
*
path
,
byte
*
buf
,
uint
size
);
int
as_path_getlen
(
struct
adata
*
path
);
int
as_path_getlen_int
(
struct
adata
*
path
,
int
bs
);
int
as_path_get_first
(
struct
adata
*
path
,
u32
*
orig_as
);
...
...
@@ -95,9 +95,9 @@ static inline u64 ec_ip4(u64 kind, u64 key, u64 val)
static
inline
u64
ec_generic
(
u64
key
,
u64
val
)
{
return
(
key
<<
32
)
|
val
;
}
int
int_set_format
(
struct
adata
*
set
,
int
way
,
int
from
,
byte
*
buf
,
u
nsigned
int
size
);
int
int_set_format
(
struct
adata
*
set
,
int
way
,
int
from
,
byte
*
buf
,
uint
size
);
int
ec_format
(
byte
*
buf
,
u64
ec
);
int
ec_set_format
(
struct
adata
*
set
,
int
from
,
byte
*
buf
,
u
nsigned
int
size
);
int
ec_set_format
(
struct
adata
*
set
,
int
from
,
byte
*
buf
,
uint
size
);
int
int_set_contains
(
struct
adata
*
list
,
u32
val
);
int
ec_set_contains
(
struct
adata
*
list
,
u64
val
);
struct
adata
*
int_set_add
(
struct
linpool
*
pool
,
struct
adata
*
list
,
u32
val
);
...
...
nest/cli.c
View file @
ae80a2de
...
...
@@ -163,7 +163,7 @@ static void
cli_copy_message
(
cli
*
c
)
{
byte
*
p
,
*
q
;
u
nsigned
int
cnt
=
2
;
uint
cnt
=
2
;
if
(
c
->
ring_overflow
)
{
...
...
@@ -230,12 +230,12 @@ cli_written(cli *c)
static
byte
*
cli_rh_pos
;
static
u
nsigned
int
cli_rh_len
;
static
uint
cli_rh_len
;
static
int
cli_rh_trick_flag
;
struct
cli
*
this_cli
;
static
int
cli_cmd_read_hook
(
byte
*
buf
,
u
nsigned
int
max
,
UNUSED
int
fd
)
cli_cmd_read_hook
(
byte
*
buf
,
uint
max
,
UNUSED
int
fd
)
{
if
(
!
cli_rh_trick_flag
)
{
...
...
@@ -330,7 +330,7 @@ static list cli_log_hooks;
static
int
cli_log_inited
;
void
cli_set_log_echo
(
cli
*
c
,
u
nsigned
int
mask
,
unsigned
int
size
)
cli_set_log_echo
(
cli
*
c
,
u
int
mask
,
u
int
size
)
{
if
(
c
->
ring_buf
)
{
...
...
@@ -351,7 +351,7 @@ cli_set_log_echo(cli *c, unsigned int mask, unsigned int size)
}
void
cli_echo
(
u
nsigned
int
class
,
byte
*
msg
)
cli_echo
(
uint
class
,
byte
*
msg
)
{
unsigned
len
,
free
,
i
,
l
;
cli
*
c
;
...
...
nest/cli.h
View file @
ae80a2de
...
...
@@ -40,10 +40,10 @@ typedef struct cli {
struct
linpool
*
parser_pool
;
/* Pool used during parsing */
byte
*
ring_buf
;
/* Ring buffer for asynchronous messages */
byte
*
ring_end
,
*
ring_read
,
*
ring_write
;
/* Pointers to the ring buffer */
u
nsigned
int
ring_overflow
;
/* Counter of ring overflows */
u
nsigned
int
log_mask
;
/* Mask of allowed message levels */
u
nsigned
int
log_threshold
;
/* When free < log_threshold, store only important messages */
u
nsigned
int
async_msg_size
;
/* Total size of async messages queued in tx_buf */
u
int
ring_overflow
;
/* Counter of ring overflows */
u
int
log_mask
;
/* Mask of allowed message levels */
u
int
log_threshold
;
/* When free < log_threshold, store only important messages */
u
int
async_msg_size
;
/* Total size of async messages queued in tx_buf */
}
cli
;
extern
pool
*
cli_pool
;
...
...
@@ -55,7 +55,7 @@ extern struct cli *this_cli; /* Used during parsing */
void
cli_printf
(
cli
*
,
int
,
char
*
,
...);
#define cli_msg(x...) cli_printf(this_cli, x)
void
cli_set_log_echo
(
cli
*
,
u
nsigned
int
mask
,
unsigned
int
size
);
void
cli_set_log_echo
(
cli
*
,
u
int
mask
,
u
int
size
);
/* Functions provided to sysdep layer */
...
...
@@ -64,7 +64,7 @@ void cli_init(void);
void
cli_free
(
cli
*
);
void
cli_kick
(
cli
*
);
void
cli_written
(
cli
*
);
void
cli_echo
(
u
nsigned
int
class
,
byte
*
msg
);
void
cli_echo
(
uint
class
,
byte
*
msg
);
static
inline
int
cli_access_restricted
(
void
)
{
...
...
nest/neighbor.c
View file @
ae80a2de
...
...
@@ -49,7 +49,7 @@
static
slab
*
neigh_slab
;
static
list
sticky_neigh_list
,
neigh_hash_table
[
NEIGH_HASH_SIZE
];
static
inline
u
nsigned
int
static
inline
uint
neigh_hash
(
struct
proto
*
p
,
ip_addr
*
a
)
{
return
(
p
->
hash_key
^
ipa_hash
(
*
a
))
&
(
NEIGH_HASH_SIZE
-
1
);
...
...
@@ -126,7 +126,7 @@ neigh_find2(struct proto *p, ip_addr *a, struct iface *ifa, unsigned flags)
{
neighbor
*
n
;
int
class
,
scope
=
-
1
;
u
nsigned
int
h
=
neigh_hash
(
p
,
a
);
uint
h
=
neigh_hash
(
p
,
a
);
struct
iface
*
i
;
struct
ifa
*
addr
;
...
...
nest/proto.c
View file @
ae80a2de
...
...
@@ -1488,7 +1488,7 @@ proto_show_basic_info(struct proto *p)
}
void
proto_cmd_show
(
struct
proto
*
p
,
u
nsigned
int
verbose
,
int
cnt
)
proto_cmd_show
(
struct
proto
*
p
,
uint
verbose
,
int
cnt
)
{
byte
buf
[
256
],
tbuf
[
TM_DATETIME_BUFFER_SIZE
];
...
...
@@ -1524,7 +1524,7 @@ proto_cmd_show(struct proto *p, unsigned int verbose, int cnt)
}
void
proto_cmd_disable
(
struct
proto
*
p
,
u
nsigned
int
arg
UNUSED
,
int
cnt
UNUSED
)
proto_cmd_disable
(
struct
proto
*
p
,
uint
arg
UNUSED
,
int
cnt
UNUSED
)
{
if
(
p
->
disabled
)
{
...
...
@@ -1540,7 +1540,7 @@ proto_cmd_disable(struct proto *p, unsigned int arg UNUSED, int cnt UNUSED)
}
void
proto_cmd_enable
(
struct
proto
*
p
,
u
nsigned
int
arg
UNUSED
,
int
cnt
UNUSED
)
proto_cmd_enable
(
struct
proto
*
p
,
uint
arg
UNUSED
,
int
cnt
UNUSED
)
{
if
(
!
p
->
disabled
)
{
...
...
@@ -1555,7 +1555,7 @@ proto_cmd_enable(struct proto *p, unsigned int arg UNUSED, int cnt UNUSED)
}
void
proto_cmd_restart
(
struct
proto
*
p
,
u
nsigned
int
arg
UNUSED
,
int
cnt
UNUSED
)
proto_cmd_restart
(
struct
proto
*
p
,
uint
arg
UNUSED
,
int
cnt
UNUSED
)
{
if
(
p
->
disabled
)
{
...
...
@@ -1573,7 +1573,7 @@ proto_cmd_restart(struct proto *p, unsigned int arg UNUSED, int cnt UNUSED)
}
void
proto_cmd_reload
(
struct
proto
*
p
,
u
nsigned
int
dir
,
int
cnt
UNUSED
)
proto_cmd_reload
(
struct
proto
*
p
,
uint
dir
,
int
cnt
UNUSED
)
{
if
(
p
->
disabled
)
{
...
...
@@ -1615,19 +1615,19 @@ proto_cmd_reload(struct proto *p, unsigned int dir, int cnt UNUSED)
}
void
proto_cmd_debug
(
struct
proto
*
p
,
u
nsigned
int
mask
,
int
cnt
UNUSED
)
proto_cmd_debug
(
struct
proto
*
p
,
uint
mask
,
int
cnt
UNUSED
)
{
p
->
debug
=
mask
;
}
void
proto_cmd_mrtdump
(
struct
proto
*
p
,
u
nsigned
int
mask
,
int
cnt
UNUSED
)
proto_cmd_mrtdump
(
struct
proto
*
p
,
uint
mask
,
int
cnt
UNUSED
)
{
p
->
mrtdump
=
mask
;
}
static
void
proto_apply_cmd_symbol
(
struct
symbol
*
s
,
void
(
*
cmd
)(
struct
proto
*
,
u
nsigned
int
,
int
),
unsigned
int
arg
)
proto_apply_cmd_symbol
(
struct
symbol
*
s
,
void
(
*
cmd
)(
struct
proto
*
,
u
int
,
int
),
u
int
arg
)
{
if
(
s
->
class
!=
SYM_PROTO
)
{
...
...
@@ -1640,7 +1640,7 @@ proto_apply_cmd_symbol(struct symbol *s, void (* cmd)(struct proto *, unsigned i
}
static
void
proto_apply_cmd_patt
(
char
*
patt
,
void
(
*
cmd
)(
struct
proto
*
,
u
nsigned
int
,
int
),
unsigned
int
arg
)
proto_apply_cmd_patt
(
char
*
patt
,
void
(
*
cmd
)(
struct
proto
*
,
u
int
,
int
),
u
int
arg
)
{
int
cnt
=
0
;
...
...
@@ -1660,8 +1660,8 @@ proto_apply_cmd_patt(char *patt, void (* cmd)(struct proto *, unsigned int, int)
}
void
proto_apply_cmd
(
struct
proto_spec
ps
,
void
(
*
cmd
)(
struct
proto
*
,
u
nsigned
int
,
int
),
int
restricted
,
u
nsigned
int
arg
)
proto_apply_cmd
(
struct
proto_spec
ps
,
void
(
*
cmd
)(
struct
proto
*
,
uint
,
int
),
int
restricted
,
uint
arg
)
{
if
(
restricted
&&
cli_access_restricted
())
return
;
...
...
nest/protocol.h
View file @
ae80a2de
...
...
@@ -261,15 +261,15 @@ void proto_graceful_restart_unlock(struct proto *p);
void
proto_show_limit
(
struct
proto_limit
*
l
,
const
char
*
dsc
);
void
proto_show_basic_info
(
struct
proto
*
p
);
void
proto_cmd_show
(
struct
proto
*
,
u
nsigned
int
,
int
);
void
proto_cmd_disable
(
struct
proto
*
,
u
nsigned
int
,
int
);
void
proto_cmd_enable
(
struct
proto
*
,
u
nsigned
int
,
int
);
void
proto_cmd_restart
(
struct
proto
*
,
u
nsigned
int
,
int
);
void
proto_cmd_reload
(
struct
proto
*
,
u
nsigned
int
,
int
);
void
proto_cmd_debug
(
struct
proto
*
,
u
nsigned
int
,
int
);
void
proto_cmd_mrtdump
(
struct
proto
*
,
u
nsigned
int
,
int
);
void
proto_apply_cmd
(
struct
proto_spec
ps
,
void
(
*
cmd
)(
struct
proto
*
,
u
nsigned
int
,
int
),
int
restricted
,
unsigned
int
arg
);
void
proto_cmd_show
(
struct
proto
*
,
uint
,
int
);
void
proto_cmd_disable
(
struct
proto
*
,
uint
,
int
);
void
proto_cmd_enable
(
struct
proto
*
,
uint
,
int
);
void
proto_cmd_restart
(
struct
proto
*
,
uint
,
int
);
void
proto_cmd_reload
(
struct
proto
*
,
uint
,
int
);
void
proto_cmd_debug
(
struct
proto
*
,
uint
,
int
);
void
proto_cmd_mrtdump
(
struct
proto
*
,
uint
,
int
);
void
proto_apply_cmd
(
struct
proto_spec
ps
,
void
(
*
cmd
)(
struct
proto
*
,
u
int
,
int
),
int
restricted
,
u
int
arg
);
struct
proto
*
proto_get_named
(
struct
symbol
*
,
struct
protocol
*
);
#define CMD_RELOAD 0
...
...
nest/route.h
View file @
ae80a2de
...
...
@@ -47,7 +47,7 @@ struct fib_iterator { /* See lib/slists.h for an explanation */
byte
efef
;
/* 0xff to distinguish between iterator and node */
byte
pad
[
3
];
struct
fib_node
*
node
;
/* Or NULL if freshly merged */
u
nsigned
int
hash
;
uint
hash
;
};
typedef
void
(
*
fib_init_func
)(
struct
fib_node
*
);
...
...
@@ -56,11 +56,11 @@ struct fib {
pool
*
fib_pool
;
/* Pool holding all our data */
slab
*
fib_slab
;
/* Slab holding all fib nodes */
struct
fib_node
**
hash_table
;
/* Node hash table */
u
nsigned
int
hash_size
;
/* Number of hash table entries (a power of two) */
u
nsigned
int
hash_order
;
/* Binary logarithm of hash_size */
u
nsigned
int
hash_shift
;
/* 16 - hash_log */
u
nsigned
int
entries
;
/* Number of entries */
u
nsigned
int
entries_min
,
entries_max
;
/* Entry count limits (else start rehashing) */
u
int
hash_size
;
/* Number of hash table entries (a power of two) */
u
int
hash_order
;
/* Binary logarithm of hash_size */
u
int
hash_shift
;
/* 16 - hash_log */
u
int
entries
;
/* Number of entries */
u
int
entries_min
,
entries_max
;
/* Entry count limits (else start rehashing) */
fib_init_func
init
;
/* Constructor */
};
...
...
@@ -78,7 +78,7 @@ void fit_put(struct fib_iterator *, struct fib_node *);
#define FIB_WALK(fib, z) do { \
struct fib_node *z, **ff = (fib)->hash_table; \
u
nsigned int count = (fib)->hash_size;
\
u
int count = (fib)->hash_size;
\
while (count--) \
for(z = *ff++; z; z=z->next)
...
...
@@ -88,8 +88,8 @@ void fit_put(struct fib_iterator *, struct fib_node *);
#define FIB_ITERATE_START(fib, it, z) do { \
struct fib_node *z = fit_get(fib, it); \
u
nsigned int count = (fib)->hash_size;
\
u
nsigned int hpos = (it)->hash;
\
u
int count = (fib)->hash_size;
\
u
int hpos = (it)->hash;
\
for(;;) { \
if (!z) \
{ \
...
...
@@ -435,7 +435,7 @@ typedef struct eattr {
#define EAF_TEMP 0x80
/* A temporary attribute (the one stored in the tmp attr list) */
struct
adata
{
u
nsigned
int
length
;
/* Length of data */
u
int
length
;
/* Length of data */
byte
data
[
0
];
};
...
...
@@ -475,7 +475,7 @@ void ea_sort(ea_list *); /* Sort entries in all sub-lists */
unsigned
ea_scan
(
ea_list
*
);
/* How many bytes do we need for merged ea_list */
void
ea_merge
(
ea_list
*
from
,
ea_list
*
to
);
/* Merge sub-lists to allocated buffer */
int
ea_same
(
ea_list
*
x
,
ea_list
*
y
);
/* Test whether two ea_lists are identical */
u
nsigned
int
ea_hash
(
ea_list
*
e
);
/* Calculate 16-bit hash value */
uint
ea_hash
(
ea_list
*
e
);
/* Calculate 16-bit hash value */
ea_list
*
ea_append
(
ea_list
*
to
,
ea_list
*
what
);
void
ea_format_bitfield
(
struct
eattr
*
a
,
byte
*
buf
,
int
bufsize
,
const
char
**
names
,
int
min
,
int
max
);
...
...
nest/rt-attr.c
View file @
ae80a2de
...
...
@@ -98,7 +98,7 @@ rte_src_init(void)
HASH_INIT
(
src_hash
,
rta_pool
,
RSH_INIT_ORDER
);
}
static
inline
int
u32_cto
(
u
nsigned
int
x
)
{
return
ffs
(
~
x
)
-
1
;
}
static
inline
int
u32_cto
(
uint
x
)
{
return
ffs
(
~
x
)
-
1
;
}
static
inline
u32
rte_src_alloc_id
(
void
)
...
...
@@ -195,10 +195,10 @@ rt_prune_sources(void)
* Multipath Next Hop
*/
static
inline
u
nsigned
int
static
inline
uint
mpnh_hash
(
struct
mpnh
*
x
)
{
u
nsigned
int
h
=
0
;
uint
h
=
0
;
for
(;
x
;
x
=
x
->
next
)
h
^=
ipa_hash
(
x
->
gw
);
...
...
@@ -666,7 +666,7 @@ ea_format_bitfield(struct eattr *a, byte *buf, int bufsize, const char **names,
}
static
inline
void
opaque_format
(
struct
adata
*
ad
,
byte
*
buf
,
u
nsigned
int
size
)