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
435ac6b8
Commit
435ac6b8
authored
Dec 07, 2004
by
ch[shemminger]!tgraf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iproute2: ndm states should be handled as flags
(Logical change 1.108)
parent
80354aa9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
29 deletions
+14
-29
ip/ipneigh.c
ip/ipneigh.c
+14
-29
No files found.
ip/ipneigh.c
View file @
435ac6b8
...
...
@@ -86,33 +86,6 @@ int nud_state_a2n(unsigned *state, char *arg)
return
0
;
}
char
*
nud_state_n2a
(
__u8
state
,
char
*
buf
,
int
len
)
{
switch
(
state
)
{
case
NUD_NONE
:
return
"none"
;
case
NUD_INCOMPLETE
:
return
"incomplete"
;
case
NUD_REACHABLE
:
return
"reachable"
;
case
NUD_STALE
:
return
"stale"
;
case
NUD_DELAY
:
return
"delay"
;
case
NUD_PROBE
:
return
"probe"
;
case
NUD_FAILED
:
return
"failed"
;
case
NUD_NOARP
:
return
"noarp"
;
case
NUD_PERMANENT
:
return
"permanent"
;
default:
snprintf
(
buf
,
len
,
"%x"
,
state
);
return
buf
;
}
}
static
int
flush_update
(
void
)
{
if
(
rtnl_send
(
filter
.
rth
,
filter
.
flushb
,
filter
.
flushp
)
<
0
)
{
...
...
@@ -316,8 +289,20 @@ int print_neigh(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
}
if
(
r
->
ndm_state
)
{
SPRINT_BUF
(
b1
);
fprintf
(
fp
,
" nud %s"
,
nud_state_n2a
(
r
->
ndm_state
,
b1
,
sizeof
(
b1
)));
int
nud
=
r
->
ndm_state
;
fprintf
(
fp
,
" "
);
#define PRINT_FLAG(f) if (nud & NUD_##f) { \
nud &= ~NUD_##f; fprintf(fp, #f "%s", nud ? "," : ""); }
PRINT_FLAG
(
INCOMPLETE
);
PRINT_FLAG
(
REACHABLE
);
PRINT_FLAG
(
STALE
);
PRINT_FLAG
(
DELAY
);
PRINT_FLAG
(
PROBE
);
PRINT_FLAG
(
FAILED
);
PRINT_FLAG
(
NOARP
);
PRINT_FLAG
(
PERMANENT
);
#undef PRINT_FLAG
}
fprintf
(
fp
,
"
\n
"
);
...
...
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