ReactOS
0.4.16-dev-1059-gb1cf981
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
if_api.c
Go to the documentation of this file.
1
11
/*
12
* Copyright (c) 2017 Joel Cunningham, Garmin International, Inc. <joel.cunningham@garmin.com>
13
* All rights reserved.
14
*
15
* Redistribution and use in source and binary forms, with or without modification,
16
* are permitted provided that the following conditions are met:
17
*
18
* 1. Redistributions of source code must retain the above copyright notice,
19
* this list of conditions and the following disclaimer.
20
* 2. Redistributions in binary form must reproduce the above copyright notice,
21
* this list of conditions and the following disclaimer in the documentation
22
* and/or other materials provided with the distribution.
23
* 3. The name of the author may not be used to endorse or promote products
24
* derived from this software without specific prior written permission.
25
*
26
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
27
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
29
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
31
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
34
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
35
* OF SUCH DAMAGE.
36
*
37
* This file is part of the lwIP TCP/IP stack.
38
*
39
* Author: Joel Cunningham <joel.cunningham@me.com>
40
*
41
*/
42
#include "
lwip/opt.h
"
43
44
#if LWIP_SOCKET
45
46
#include "
lwip/errno.h
"
47
#include "
lwip/if_api.h
"
48
#include "
lwip/netifapi.h
"
49
#include "
lwip/priv/sockets_priv.h
"
50
60
char
*
61
lwip_if_indextoname(
unsigned
int
ifindex,
char
*ifname)
62
{
63
#if LWIP_NETIF_API
64
if
(ifindex <= 0xff) {
65
err_t
err
= netifapi_netif_index_to_name((
u8_t
)ifindex, ifname);
66
if
(!
err
&& ifname[0] !=
'\0'
) {
67
return
ifname;
68
}
69
}
70
#else
/* LWIP_NETIF_API */
71
LWIP_UNUSED_ARG
(ifindex);
72
LWIP_UNUSED_ARG
(ifname);
73
#endif
/* LWIP_NETIF_API */
74
set_errno(
ENXIO
);
75
return
NULL
;
76
}
77
85
unsigned
int
86
lwip_if_nametoindex(
const
char
*ifname)
87
{
88
#if LWIP_NETIF_API
89
err_t
err
;
90
u8_t
idx
;
91
92
err
= netifapi_netif_name_to_index(ifname, &
idx
);
93
if
(!
err
) {
94
return
idx
;
95
}
96
#else
/* LWIP_NETIF_API */
97
LWIP_UNUSED_ARG
(ifname);
98
#endif
/* LWIP_NETIF_API */
99
return
0;
/* invalid index */
100
}
101
102
#endif
/* LWIP_SOCKET */
NULL
#define NULL
Definition:
types.h:112
idx
unsigned int idx
Definition:
utils.c:41
ENXIO
#define ENXIO
Definition:
errno.h:12
errno.h
u8_t
uint8_t u8_t
Definition:
arch.h:125
LWIP_UNUSED_ARG
#define LWIP_UNUSED_ARG(x)
Definition:
arch.h:373
err_t
s8_t err_t
Definition:
err.h:96
if_api.h
netifapi.h
opt.h
err
#define err(...)
Definition:
reactos_support_code.h:30
sockets_priv.h
drivers
network
tcpip
lwip
src
api
if_api.c
Generated on Wed Apr 30 2025 06:06:59 for ReactOS by
1.9.6