Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iproute2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
iproute2
Commits
892e2124
Commit
892e2124
authored
Aug 13, 2015
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnecessary extern
No need for extern on function prototypes.
parent
a02371fb
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
84 deletions
+87
-84
include/dlfcn.h
include/dlfcn.h
+1
-1
include/libnetlink.h
include/libnetlink.h
+42
-39
include/ll_map.h
include/ll_map.h
+9
-9
include/namespace.h
include/namespace.h
+3
-3
include/utils.h
include/utils.h
+32
-32
No files found.
include/dlfcn.h
View file @
892e2124
...
...
@@ -19,7 +19,7 @@ static inline void *dlopen(const char *file, int flag)
return
NULL
;
}
extern
void
*
_dlsym
(
const
char
*
sym
);
void
*
_dlsym
(
const
char
*
sym
);
static
inline
void
*
dlsym
(
void
*
handle
,
const
char
*
sym
)
{
if
(
handle
!=
_FAKE_DLFCN_HDL
)
...
...
include/libnetlink.h
View file @
892e2124
...
...
@@ -26,20 +26,20 @@ struct rtnl_handle
extern
int
rcvbuf
;
extern
int
rtnl_open
(
struct
rtnl_handle
*
rth
,
unsigned
subscriptions
)
int
rtnl_open
(
struct
rtnl_handle
*
rth
,
unsigned
subscriptions
)
__attribute__
((
warn_unused_result
));
extern
int
rtnl_open_byproto
(
struct
rtnl_handle
*
rth
,
unsigned
subscriptions
,
int
rtnl_open_byproto
(
struct
rtnl_handle
*
rth
,
unsigned
subscriptions
,
int
protocol
)
__attribute__
((
warn_unused_result
));
extern
void
rtnl_close
(
struct
rtnl_handle
*
rth
);
extern
int
rtnl_wilddump_request
(
struct
rtnl_handle
*
rth
,
int
fam
,
int
type
)
void
rtnl_close
(
struct
rtnl_handle
*
rth
);
int
rtnl_wilddump_request
(
struct
rtnl_handle
*
rth
,
int
fam
,
int
type
)
__attribute__
((
warn_unused_result
));
extern
int
rtnl_wilddump_req_filter
(
struct
rtnl_handle
*
rth
,
int
fam
,
int
type
,
int
rtnl_wilddump_req_filter
(
struct
rtnl_handle
*
rth
,
int
fam
,
int
type
,
__u32
filt_mask
)
__attribute__
((
warn_unused_result
));
extern
int
rtnl_dump_request
(
struct
rtnl_handle
*
rth
,
int
type
,
void
*
req
,
int
rtnl_dump_request
(
struct
rtnl_handle
*
rth
,
int
type
,
void
*
req
,
int
len
)
__attribute__
((
warn_unused_result
));
...
...
@@ -60,40 +60,43 @@ struct rtnl_dump_filter_arg
void
*
arg1
;
};
extern
int
rtnl_dump_filter_l
(
struct
rtnl_handle
*
rth
,
int
rtnl_dump_filter_l
(
struct
rtnl_handle
*
rth
,
const
struct
rtnl_dump_filter_arg
*
arg
);
extern
int
rtnl_dump_filter
(
struct
rtnl_handle
*
rth
,
rtnl_filter_t
filter
,
void
*
arg
);
extern
int
rtnl_talk
(
struct
rtnl_handle
*
rtnl
,
struct
nlmsghdr
*
n
,
int
rtnl_dump_filter
(
struct
rtnl_handle
*
rth
,
rtnl_filter_t
filter
,
void
*
arg
);
int
rtnl_talk
(
struct
rtnl_handle
*
rtnl
,
struct
nlmsghdr
*
n
,
struct
nlmsghdr
*
answer
,
size_t
len
)
__attribute__
((
warn_unused_result
));
extern
int
rtnl_send
(
struct
rtnl_handle
*
rth
,
const
void
*
buf
,
int
)
int
rtnl_send
(
struct
rtnl_handle
*
rth
,
const
void
*
buf
,
int
)
__attribute__
((
warn_unused_result
));
extern
int
rtnl_send_check
(
struct
rtnl_handle
*
rth
,
const
void
*
buf
,
int
)
int
rtnl_send_check
(
struct
rtnl_handle
*
rth
,
const
void
*
buf
,
int
)
__attribute__
((
warn_unused_result
));
extern
int
addattr
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
);
extern
int
addattr8
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
__u8
data
);
extern
int
addattr16
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
__u16
data
);
extern
int
addattr32
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
__u32
data
);
extern
int
addattr64
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
__u64
data
);
extern
int
addattrstrz
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
const
char
*
data
);
extern
int
addattr_l
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
const
void
*
data
,
int
alen
);
extern
int
addraw_l
(
struct
nlmsghdr
*
n
,
int
maxlen
,
const
void
*
data
,
int
len
);
extern
struct
rtattr
*
addattr_nest
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
);
extern
int
addattr_nest_end
(
struct
nlmsghdr
*
n
,
struct
rtattr
*
nest
);
extern
struct
rtattr
*
addattr_nest_compat
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
const
void
*
data
,
int
len
);
extern
int
addattr_nest_compat_end
(
struct
nlmsghdr
*
n
,
struct
rtattr
*
nest
);
extern
int
rta_addattr32
(
struct
rtattr
*
rta
,
int
maxlen
,
int
type
,
__u32
data
);
extern
int
rta_addattr_l
(
struct
rtattr
*
rta
,
int
maxlen
,
int
type
,
const
void
*
data
,
int
alen
);
extern
int
parse_rtattr
(
struct
rtattr
*
tb
[],
int
max
,
struct
rtattr
*
rta
,
int
len
);
extern
int
parse_rtattr_flags
(
struct
rtattr
*
tb
[],
int
max
,
struct
rtattr
*
rta
,
int
addattr
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
);
int
addattr8
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
__u8
data
);
int
addattr16
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
__u16
data
);
int
addattr32
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
__u32
data
);
int
addattr64
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
__u64
data
);
int
addattrstrz
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
const
char
*
data
);
int
addattr_l
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
const
void
*
data
,
int
alen
);
int
addraw_l
(
struct
nlmsghdr
*
n
,
int
maxlen
,
const
void
*
data
,
int
len
);
struct
rtattr
*
addattr_nest
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
);
int
addattr_nest_end
(
struct
nlmsghdr
*
n
,
struct
rtattr
*
nest
);
struct
rtattr
*
addattr_nest_compat
(
struct
nlmsghdr
*
n
,
int
maxlen
,
int
type
,
const
void
*
data
,
int
len
);
int
addattr_nest_compat_end
(
struct
nlmsghdr
*
n
,
struct
rtattr
*
nest
);
int
rta_addattr32
(
struct
rtattr
*
rta
,
int
maxlen
,
int
type
,
__u32
data
);
int
rta_addattr_l
(
struct
rtattr
*
rta
,
int
maxlen
,
int
type
,
const
void
*
data
,
int
alen
);
int
parse_rtattr
(
struct
rtattr
*
tb
[],
int
max
,
struct
rtattr
*
rta
,
int
len
);
int
parse_rtattr_flags
(
struct
rtattr
*
tb
[],
int
max
,
struct
rtattr
*
rta
,
int
len
,
unsigned
short
flags
);
extern
int
parse_rtattr_byindex
(
struct
rtattr
*
tb
[],
int
max
,
struct
rtattr
*
rta
,
int
len
);
extern
struct
rtattr
*
parse_rtattr_one
(
int
type
,
struct
rtattr
*
rta
,
int
len
);
extern
int
__parse_rtattr_nested_compat
(
struct
rtattr
*
tb
[],
int
max
,
struct
rtattr
*
rta
,
int
len
);
int
parse_rtattr_byindex
(
struct
rtattr
*
tb
[],
int
max
,
struct
rtattr
*
rta
,
int
len
);
struct
rtattr
*
parse_rtattr_one
(
int
type
,
struct
rtattr
*
rta
,
int
len
);
int
__parse_rtattr_nested_compat
(
struct
rtattr
*
tb
[],
int
max
,
struct
rtattr
*
rta
,
int
len
);
#define parse_rtattr_nested(tb, max, rta) \
(parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta)))
...
...
@@ -128,10 +131,10 @@ static inline const char *rta_getattr_str(const struct rtattr *rta)
return
(
const
char
*
)
RTA_DATA
(
rta
);
}
extern
int
rtnl_listen_all_nsid
(
struct
rtnl_handle
*
);
extern
int
rtnl_listen
(
struct
rtnl_handle
*
,
rtnl_listen_filter_t
handler
,
int
rtnl_listen_all_nsid
(
struct
rtnl_handle
*
);
int
rtnl_listen
(
struct
rtnl_handle
*
,
rtnl_listen_filter_t
handler
,
void
*
jarg
);
extern
int
rtnl_from_file
(
FILE
*
,
rtnl_listen_filter_t
handler
,
int
rtnl_from_file
(
FILE
*
,
rtnl_listen_filter_t
handler
,
void
*
jarg
);
#define NLMSG_TAIL(nmsg) \
...
...
include/ll_map.h
View file @
892e2124
#ifndef __LL_MAP_H__
#define __LL_MAP_H__ 1
extern
int
ll_remember_index
(
const
struct
sockaddr_nl
*
who
,
int
ll_remember_index
(
const
struct
sockaddr_nl
*
who
,
struct
nlmsghdr
*
n
,
void
*
arg
);
extern
void
ll_init_map
(
struct
rtnl_handle
*
rth
);
extern
unsigned
ll_name_to_index
(
const
char
*
name
);
extern
const
char
*
ll_index_to_name
(
unsigned
idx
);
extern
const
char
*
ll_idx_n2a
(
unsigned
idx
,
char
*
buf
);
extern
int
ll_index_to_type
(
unsigned
idx
);
extern
int
ll_index_to_flags
(
unsigned
idx
);
extern
unsigned
namehash
(
const
char
*
str
);
void
ll_init_map
(
struct
rtnl_handle
*
rth
);
unsigned
ll_name_to_index
(
const
char
*
name
);
const
char
*
ll_index_to_name
(
unsigned
idx
);
const
char
*
ll_idx_n2a
(
unsigned
idx
,
char
*
buf
);
int
ll_index_to_type
(
unsigned
idx
);
int
ll_index_to_flags
(
unsigned
idx
);
unsigned
namehash
(
const
char
*
str
);
#endif
/* __LL_MAP_H__ */
include/namespace.h
View file @
892e2124
...
...
@@ -43,9 +43,9 @@ static inline int setns(int fd, int nstype)
}
#endif
/* HAVE_SETNS */
extern
int
netns_switch
(
char
*
netns
);
extern
int
netns_get_fd
(
const
char
*
netns
);
extern
int
netns_foreach
(
int
(
*
func
)(
char
*
nsname
,
void
*
arg
),
void
*
arg
);
int
netns_switch
(
char
*
netns
);
int
netns_get_fd
(
const
char
*
netns
);
int
netns_foreach
(
int
(
*
func
)(
char
*
nsname
,
void
*
arg
),
void
*
arg
);
struct
netns_func
{
int
(
*
func
)(
char
*
nsname
,
void
*
arg
);
...
...
include/utils.h
View file @
892e2124
...
...
@@ -42,7 +42,7 @@ extern bool do_all;
#define SPRINT_BSIZE 64
#define SPRINT_BUF(x) char x[SPRINT_BSIZE]
extern
void
incomplete_command
(
void
)
__attribute__
((
noreturn
));
void
incomplete_command
(
void
)
__attribute__
((
noreturn
));
#define NEXT_ARG() do { argv++; if (--argc <= 0) incomplete_command(); } while(0)
#define NEXT_ARG_OK() (argc - 1 > 0)
...
...
@@ -85,47 +85,47 @@ struct ipx_addr {
/* Maximum number of labels the mpls helpers support */
#define MPLS_MAX_LABELS 8
extern
__u32
get_addr32
(
const
char
*
name
);
extern
int
get_addr_1
(
inet_prefix
*
dst
,
const
char
*
arg
,
int
family
);
extern
int
get_prefix_1
(
inet_prefix
*
dst
,
char
*
arg
,
int
family
);
extern
int
get_addr
(
inet_prefix
*
dst
,
const
char
*
arg
,
int
family
);
extern
int
get_prefix
(
inet_prefix
*
dst
,
char
*
arg
,
int
family
);
extern
int
mask2bits
(
__u32
netmask
);
__u32
get_addr32
(
const
char
*
name
);
int
get_addr_1
(
inet_prefix
*
dst
,
const
char
*
arg
,
int
family
);
int
get_prefix_1
(
inet_prefix
*
dst
,
char
*
arg
,
int
family
);
int
get_addr
(
inet_prefix
*
dst
,
const
char
*
arg
,
int
family
);
int
get_prefix
(
inet_prefix
*
dst
,
char
*
arg
,
int
family
);
int
mask2bits
(
__u32
netmask
);
extern
int
get_integer
(
int
*
val
,
const
char
*
arg
,
int
base
);
extern
int
get_unsigned
(
unsigned
*
val
,
const
char
*
arg
,
int
base
);
extern
int
get_time_rtt
(
unsigned
*
val
,
const
char
*
arg
,
int
*
raw
);
int
get_integer
(
int
*
val
,
const
char
*
arg
,
int
base
);
int
get_unsigned
(
unsigned
*
val
,
const
char
*
arg
,
int
base
);
int
get_time_rtt
(
unsigned
*
val
,
const
char
*
arg
,
int
*
raw
);
#define get_byte get_u8
#define get_ushort get_u16
#define get_short get_s16
extern
int
get_u64
(
__u64
*
val
,
const
char
*
arg
,
int
base
);
extern
int
get_u32
(
__u32
*
val
,
const
char
*
arg
,
int
base
);
extern
int
get_s32
(
__s32
*
val
,
const
char
*
arg
,
int
base
);
extern
int
get_u16
(
__u16
*
val
,
const
char
*
arg
,
int
base
);
extern
int
get_s16
(
__s16
*
val
,
const
char
*
arg
,
int
base
);
extern
int
get_u8
(
__u8
*
val
,
const
char
*
arg
,
int
base
);
extern
int
get_s8
(
__s8
*
val
,
const
char
*
arg
,
int
base
);
int
get_u64
(
__u64
*
val
,
const
char
*
arg
,
int
base
);
int
get_u32
(
__u32
*
val
,
const
char
*
arg
,
int
base
);
int
get_s32
(
__s32
*
val
,
const
char
*
arg
,
int
base
);
int
get_u16
(
__u16
*
val
,
const
char
*
arg
,
int
base
);
int
get_s16
(
__s16
*
val
,
const
char
*
arg
,
int
base
);
int
get_u8
(
__u8
*
val
,
const
char
*
arg
,
int
base
);
int
get_s8
(
__s8
*
val
,
const
char
*
arg
,
int
base
);
extern
char
*
hexstring_n2a
(
const
__u8
*
str
,
int
len
,
char
*
buf
,
int
blen
);
extern
__u8
*
hexstring_a2n
(
const
char
*
str
,
__u8
*
buf
,
int
blen
);
char
*
hexstring_n2a
(
const
__u8
*
str
,
int
len
,
char
*
buf
,
int
blen
);
__u8
*
hexstring_a2n
(
const
char
*
str
,
__u8
*
buf
,
int
blen
);
extern
int
af_bit_len
(
int
af
);
extern
int
af_byte_len
(
int
af
);
int
af_bit_len
(
int
af
);
int
af_byte_len
(
int
af
);
extern
const
char
*
format_host
(
int
af
,
int
len
,
const
void
*
addr
,
const
char
*
format_host
(
int
af
,
int
len
,
const
void
*
addr
,
char
*
buf
,
int
buflen
);
extern
const
char
*
rt_addr_n2a
(
int
af
,
int
len
,
const
void
*
addr
,
const
char
*
rt_addr_n2a
(
int
af
,
int
len
,
const
void
*
addr
,
char
*
buf
,
int
buflen
);
extern
int
read_family
(
const
char
*
name
);
extern
const
char
*
family_name
(
int
family
);
int
read_family
(
const
char
*
name
);
const
char
*
family_name
(
int
family
);
void
missarg
(
const
char
*
)
__attribute__
((
noreturn
));
void
invarg
(
const
char
*
,
const
char
*
)
__attribute__
((
noreturn
));
void
duparg
(
const
char
*
,
const
char
*
)
__attribute__
((
noreturn
));
void
duparg2
(
const
char
*
,
const
char
*
)
__attribute__
((
noreturn
));
int
matches
(
const
char
*
arg
,
const
char
*
pattern
);
extern
int
inet_addr_match
(
const
inet_prefix
*
a
,
const
inet_prefix
*
b
,
int
bits
);
int
inet_addr_match
(
const
inet_prefix
*
a
,
const
inet_prefix
*
b
,
int
bits
);
const
char
*
dnet_ntop
(
int
af
,
const
void
*
addr
,
char
*
str
,
size_t
len
);
int
dnet_pton
(
int
af
,
const
char
*
src
,
void
*
addr
);
...
...
@@ -137,7 +137,7 @@ const char *mpls_ntop(int af, const void *addr, char *str, size_t len);
int
mpls_pton
(
int
af
,
const
char
*
src
,
void
*
addr
);
extern
int
__iproute2_hz_internal
;
extern
int
__get_hz
(
void
);
__get_hz
(
void
);
static
__inline__
int
get_hz
(
void
)
{
...
...
@@ -147,7 +147,7 @@ static __inline__ int get_hz(void)
}
extern
int
__iproute2_user_hz_internal
;
extern
int
__get_user_hz
(
void
);
int
__get_user_hz
(
void
);
static
__inline__
int
get_user_hz
(
void
)
{
...
...
@@ -191,16 +191,16 @@ void print_nlmsg_timestamp(FILE *fp, const struct nlmsghdr *n);
#endif
extern
int
cmdlineno
;
extern
ssize_t
getcmdline
(
char
**
line
,
size_t
*
len
,
FILE
*
in
);
extern
int
makeargs
(
char
*
line
,
char
*
argv
[],
int
maxargs
);
extern
int
inet_get_addr
(
const
char
*
src
,
__u32
*
dst
,
struct
in6_addr
*
dst6
);
ssize_t
getcmdline
(
char
**
line
,
size_t
*
len
,
FILE
*
in
);
int
makeargs
(
char
*
line
,
char
*
argv
[],
int
maxargs
);
int
inet_get_addr
(
const
char
*
src
,
__u32
*
dst
,
struct
in6_addr
*
dst6
);
struct
iplink_req
;
int
iplink_parse
(
int
argc
,
char
**
argv
,
struct
iplink_req
*
req
,
char
**
name
,
char
**
type
,
char
**
link
,
char
**
dev
,
int
*
group
,
int
*
index
);
extern
int
do_each_netns
(
int
(
*
func
)(
char
*
nsname
,
void
*
arg
),
void
*
arg
,
int
do_each_netns
(
int
(
*
func
)(
char
*
nsname
,
void
*
arg
),
void
*
arg
,
bool
show_label
);
char
*
int_to_str
(
int
val
,
char
*
buf
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment