Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
11d332c3
Commit
11d332c3
authored
Sep 27, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Sep 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ipconfig: Implement gateway address output.
parent
7df2d4b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
2 deletions
+44
-2
En.rc
programs/ipconfig/En.rc
+1
-0
ipconfig.c
programs/ipconfig/ipconfig.c
+42
-2
ipconfig.h
programs/ipconfig/ipconfig.h
+1
-0
No files found.
programs/ipconfig/En.rc
View file @
11d332c3
...
...
@@ -44,4 +44,5 @@ STRINGTABLE
STRING_DHCP_ENABLED, "DHCP enabled"
STRING_YES, "Yes"
STRING_NO, "No"
STRING_DEFAULT_GATEWAY, "Default gateway"
}
programs/ipconfig/ipconfig.c
View file @
11d332c3
...
...
@@ -130,6 +130,17 @@ static void print_field(int msg, const WCHAR *value)
ipconfig_printfW
(
formatW
,
field
,
value
);
}
static
void
print_value
(
const
WCHAR
*
value
)
{
static
const
WCHAR
formatW
[]
=
{
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
'%'
,
's'
,
'\n'
,
0
};
ipconfig_printfW
(
formatW
,
value
);
}
static
BOOL
socket_address_to_string
(
WCHAR
*
buf
,
DWORD
len
,
SOCKET_ADDRESS
*
addr
)
{
return
WSAAddressToStringW
(
addr
->
lpSockaddr
,
...
...
@@ -155,8 +166,10 @@ static void print_basic_information(void)
for
(
p
=
adapters
;
p
;
p
=
p
->
Next
)
{
static
const
WCHAR
newlineW
[]
=
{
'\n'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
IP_ADAPTER_UNICAST_ADDRESS
*
addr
;
IP_ADAPTER_GATEWAY_ADDRESS_LH
*
gateway
;
WCHAR
addr_buf
[
54
];
ipconfig_message_printfW
(
STRING_ADAPTER_FRIENDLY
,
iftype_to_string
(
p
->
IfType
),
p
->
FriendlyName
);
...
...
@@ -170,7 +183,20 @@ static void print_basic_information(void)
/* FIXME: Output corresponding subnet mask. */
}
/* FIXME: Output default gateway address. */
if
(
p
->
FirstGatewayAddress
)
{
if
(
socket_address_to_string
(
addr_buf
,
sizeof
(
addr_buf
)
/
sizeof
(
WCHAR
),
&
p
->
FirstGatewayAddress
->
Address
))
print_field
(
STRING_DEFAULT_GATEWAY
,
addr_buf
);
for
(
gateway
=
p
->
FirstGatewayAddress
->
Next
;
gateway
;
gateway
=
gateway
->
Next
)
{
if
(
socket_address_to_string
(
addr_buf
,
sizeof
(
addr_buf
)
/
sizeof
(
WCHAR
),
&
gateway
->
Address
))
print_value
(
addr_buf
);
}
}
else
print_field
(
STRING_DEFAULT_GATEWAY
,
emptyW
);
ipconfig_printfW
(
newlineW
);
}
}
...
...
@@ -245,6 +271,7 @@ static const WCHAR *boolean_to_string(int value)
static
void
print_full_information
(
void
)
{
static
const
WCHAR
newlineW
[]
=
{
'\n'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
FIXED_INFO
*
info
;
IP_ADAPTER_ADDRESSES
*
adapters
;
...
...
@@ -290,6 +317,7 @@ static void print_full_information(void)
{
IP_ADAPTER_UNICAST_ADDRESS
*
addr
;
WCHAR
physaddr_buf
[
3
*
MAX_ADAPTER_ADDRESS_LENGTH
];
IP_ADAPTER_GATEWAY_ADDRESS_LH
*
gateway
;
WCHAR
addr_buf
[
54
];
ipconfig_message_printfW
(
STRING_ADAPTER_FRIENDLY
,
iftype_to_string
(
p
->
IfType
),
p
->
FriendlyName
);
...
...
@@ -308,7 +336,19 @@ static void print_full_information(void)
/* FIXME: Output corresponding subnet mask. */
}
/* FIXME: Output default gateway address. */
if
(
p
->
FirstGatewayAddress
)
{
if
(
socket_address_to_string
(
addr_buf
,
sizeof
(
addr_buf
)
/
sizeof
(
WCHAR
),
&
p
->
FirstGatewayAddress
->
Address
))
print_field
(
STRING_DEFAULT_GATEWAY
,
addr_buf
);
for
(
gateway
=
p
->
FirstGatewayAddress
->
Next
;
gateway
;
gateway
=
gateway
->
Next
)
{
if
(
socket_address_to_string
(
addr_buf
,
sizeof
(
addr_buf
)
/
sizeof
(
WCHAR
),
&
gateway
->
Address
))
print_value
(
addr_buf
);
}
}
else
print_field
(
STRING_DEFAULT_GATEWAY
,
emptyW
);
ipconfig_printfW
(
newlineW
);
}
...
...
programs/ipconfig/ipconfig.h
View file @
11d332c3
...
...
@@ -40,3 +40,4 @@
#define STRING_DHCP_ENABLED 117
#define STRING_YES 118
#define STRING_NO 119
#define STRING_DEFAULT_GATEWAY 120
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