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
7df2d4b2
Commit
7df2d4b2
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: Move socket address string generation to a helper function.
parent
fea9d8f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
ipconfig.c
programs/ipconfig/ipconfig.c
+11
-12
No files found.
programs/ipconfig/ipconfig.c
View file @
7df2d4b2
...
...
@@ -130,6 +130,13 @@ static void print_field(int msg, const WCHAR *value)
ipconfig_printfW
(
formatW
,
field
,
value
);
}
static
BOOL
socket_address_to_string
(
WCHAR
*
buf
,
DWORD
len
,
SOCKET_ADDRESS
*
addr
)
{
return
WSAAddressToStringW
(
addr
->
lpSockaddr
,
addr
->
iSockaddrLength
,
NULL
,
buf
,
&
len
)
==
0
;
}
static
void
print_basic_information
(
void
)
{
IP_ADAPTER_ADDRESSES
*
adapters
;
...
...
@@ -150,6 +157,7 @@ static void print_basic_information(void)
static
const
WCHAR
newlineW
[]
=
{
'\n'
,
0
};
IP_ADAPTER_UNICAST_ADDRESS
*
addr
;
WCHAR
addr_buf
[
54
];
ipconfig_message_printfW
(
STRING_ADAPTER_FRIENDLY
,
iftype_to_string
(
p
->
IfType
),
p
->
FriendlyName
);
ipconfig_printfW
(
newlineW
);
...
...
@@ -157,12 +165,7 @@ static void print_basic_information(void)
for
(
addr
=
p
->
FirstUnicastAddress
;
addr
;
addr
=
addr
->
Next
)
{
WCHAR
addr_buf
[
54
];
DWORD
len
=
sizeof
(
addr_buf
)
/
sizeof
(
WCHAR
);
if
(
WSAAddressToStringW
(
addr
->
Address
.
lpSockaddr
,
addr
->
Address
.
iSockaddrLength
,
NULL
,
addr_buf
,
&
len
)
==
0
)
if
(
socket_address_to_string
(
addr_buf
,
sizeof
(
addr_buf
)
/
sizeof
(
WCHAR
),
&
addr
->
Address
))
print_field
(
STRING_IP_ADDRESS
,
addr_buf
);
/* FIXME: Output corresponding subnet mask. */
}
...
...
@@ -287,6 +290,7 @@ static void print_full_information(void)
{
IP_ADAPTER_UNICAST_ADDRESS
*
addr
;
WCHAR
physaddr_buf
[
3
*
MAX_ADAPTER_ADDRESS_LENGTH
];
WCHAR
addr_buf
[
54
];
ipconfig_message_printfW
(
STRING_ADAPTER_FRIENDLY
,
iftype_to_string
(
p
->
IfType
),
p
->
FriendlyName
);
ipconfig_printfW
(
newlineW
);
...
...
@@ -299,12 +303,7 @@ static void print_full_information(void)
for
(
addr
=
p
->
FirstUnicastAddress
;
addr
;
addr
=
addr
->
Next
)
{
WCHAR
addr_buf
[
54
];
DWORD
len
=
sizeof
(
addr_buf
)
/
sizeof
(
WCHAR
);
if
(
WSAAddressToStringW
(
addr
->
Address
.
lpSockaddr
,
addr
->
Address
.
iSockaddrLength
,
NULL
,
addr_buf
,
&
len
)
==
0
)
if
(
socket_address_to_string
(
addr_buf
,
sizeof
(
addr_buf
)
/
sizeof
(
WCHAR
),
&
addr
->
Address
))
print_field
(
STRING_IP_ADDRESS
,
addr_buf
);
/* FIXME: Output corresponding subnet mask. */
}
...
...
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