Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos.package
Commits
7beac5ad
Commit
7beac5ad
authored
Oct 21, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ipwin: add command to show ipv6 default route
ip: support to show ipv6 default route
parent
61de57f1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
6 deletions
+29
-6
windows/ipwin/ipwin/ipwin.cpp
windows/ipwin/ipwin/ipwin.cpp
+9
-1
windows/ipwin/ipwin/netcfg.cpp
windows/ipwin/ipwin/netcfg.cpp
+17
-5
windows/scripts/ip
windows/scripts/ip
+3
-0
No files found.
windows/ipwin/ipwin/ipwin.cpp
View file @
7beac5ad
...
...
@@ -56,7 +56,7 @@ HRESULT SlaposNetCfgGetNetworkConnectionName(IN LPCWSTR pGUID,
OUT
BSTR
*
pName
,
OUT
BSTR
*
pErrMsg
);
HRESULT
SlaposIPv6ShowRoute
(
int
verbos
e
);
HRESULT
SlaposIPv6ShowRoute
(
int
mod
e
);
void
Usage
()
{
...
...
@@ -109,6 +109,9 @@ Available command:\n\
\n
\
Print IPv6 route information:
\n
\
ipwin ipv6 show route
\n
\
\n
\
Print IPv6 default route information:
\n
\
ipwin ipv6 show route default
\n
\
\n
\
\n
\
Exit status:
\n
\
...
...
@@ -344,7 +347,12 @@ int _tmain(int argc, TCHAR * argv[])
Usage
();
hr
=
E_FAIL
;
}
else
if
(
argc
==
5
)
{
// Only show default route
hr
=
SlaposIPv6ShowRoute
(
0
);
}
else
{
// Show all ipv6 route
hr
=
SlaposIPv6ShowRoute
(
1
);
}
}
...
...
windows/ipwin/ipwin/netcfg.cpp
View file @
7beac5ad
...
...
@@ -1364,7 +1364,7 @@ HRESULT SlaposNetCfgGetNetworkConnectionName(IN LPCWSTR pGUID,
return
hrc
;
}
HRESULT
SlaposIPv6ShowRoute
(
int
verbos
e
)
HRESULT
SlaposIPv6ShowRoute
(
int
mod
e
)
{
int
i
;
ULONG
NumEntries
=
-
1
;
...
...
@@ -1398,11 +1398,23 @@ HRESULT SlaposIPv6ShowRoute(int verbose)
200
);
if_indextoname
(
pRow2
->
InterfaceIndex
,
ifname
);
if
(
mode
==
1
)
{
printf
(
"Prefix : %s/%d
\n
"
,
prefix
,
(
pRow2
->
DestinationPrefix
).
PrefixLength
);
printf
(
"Interface %d : %s
\n
"
,
(
unsigned
int
)(
pRow2
->
InterfaceIndex
),
ifname
);
printf
(
"Gateway : %s
\n
"
,
gateway
);
printf
(
"
\n
"
);
}
else
if
(
mode
==
0
)
{
// Print default route
if
(
IN6_IS_ADDR_UNSPECIFIED
(
&
((
pRow2
->
DestinationPrefix
).
Prefix
.
Ipv6
.
sin6_addr
)))
printf
(
"default proto %d metric %d mtu %s advmss %s
\n
"
,
pRow2
->
Protocol
,
pRow2
->
Metric
,
"unknown"
,
"unknown"
);
}
}
FreeMibTable
(
pIpForwardTable2
);
return
S_OK
;
}
...
...
windows/scripts/ip
View file @
7beac5ad
...
...
@@ -581,6 +581,9 @@ elif [[ $object == "route" ]] ; then
if
[[
$command
!=
"show"
]]
;
then
prefix
=
$1
shift
elif
[[
"
$1
"
==
"default"
]]
;
then
ipwin ipv6 show route default
exit
$?
fi
while
[[
"
$1
"
!=
""
]]
;
do
...
...
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