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
56e8ad38
Commit
56e8ad38
authored
Mar 22, 2005
by
linux-ipv6.org!nakam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split printing policy info function for xfrm common use.
(Logical change 1.175)
parent
fb7399b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
48 deletions
+3
-48
ip/xfrm_policy.c
ip/xfrm_policy.c
+3
-48
No files found.
ip/xfrm_policy.c
View file @
56e8ad38
...
...
@@ -331,8 +331,8 @@ static int xfrm_policy_filter_match(struct xfrm_userpolicy_info *xpinfo)
return
1
;
}
static
int
xfrm_policy_print
(
const
struct
sockaddr_nl
*
who
,
struct
nlmsghdr
*
n
,
void
*
arg
)
int
xfrm_policy_print
(
const
struct
sockaddr_nl
*
who
,
struct
nlmsghdr
*
n
,
void
*
arg
)
{
FILE
*
fp
=
(
FILE
*
)
arg
;
struct
xfrm_userpolicy_info
*
xpinfo
=
NLMSG_DATA
(
n
);
...
...
@@ -360,52 +360,7 @@ static int xfrm_policy_print(const struct sockaddr_nl *who,
if
(
n
->
nlmsg_type
==
XFRM_MSG_DELPOLICY
)
fprintf
(
fp
,
"Deleted "
);
xfrm_selector_print
(
&
xpinfo
->
sel
,
preferred_family
,
fp
,
NULL
);
fprintf
(
fp
,
"
\t
"
);
fprintf
(
fp
,
"dir "
);
switch
(
xpinfo
->
dir
)
{
case
XFRM_POLICY_IN
:
fprintf
(
fp
,
"in"
);
break
;
case
XFRM_POLICY_OUT
:
fprintf
(
fp
,
"out"
);
break
;
case
XFRM_POLICY_FWD
:
fprintf
(
fp
,
"fwd"
);
break
;
default:
fprintf
(
fp
,
"%u"
,
xpinfo
->
dir
);
break
;
}
fprintf
(
fp
,
" "
);
switch
(
xpinfo
->
action
)
{
case
XFRM_POLICY_ALLOW
:
if
(
show_stats
>
0
)
fprintf
(
fp
,
"action allow "
);
break
;
case
XFRM_POLICY_BLOCK
:
fprintf
(
fp
,
"action block "
);
break
;
default:
fprintf
(
fp
,
"action %u "
,
xpinfo
->
action
);
break
;
}
if
(
show_stats
)
fprintf
(
fp
,
"index %u "
,
xpinfo
->
index
);
fprintf
(
fp
,
"priority %u "
,
xpinfo
->
priority
);
if
(
show_stats
>
0
)
{
fprintf
(
fp
,
"share %s "
,
strxf_share
(
xpinfo
->
share
));
fprintf
(
fp
,
"flag 0x%s"
,
strxf_mask8
(
xpinfo
->
flags
));
}
fprintf
(
fp
,
"%s"
,
_SL_
);
if
(
show_stats
>
0
)
xfrm_lifetime_print
(
&
xpinfo
->
lft
,
&
xpinfo
->
curlft
,
fp
,
"
\t
"
);
xfrm_xfrma_print
(
tb
,
xpinfo
->
sel
.
family
,
fp
,
"
\t
"
);
xfrm_policy_info_print
(
xpinfo
,
tb
,
fp
,
NULL
,
NULL
);
if
(
oneline
)
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