mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:14:58 +00:00
Kernel+LibC: Stub out if_nameindex() and if_freenameindex()
These should allow users to receive the names of network interfaces in the system, but for now these are only stubs required to compile some ports.
This commit is contained in:
parent
efb69508f4
commit
468ae105d8
3 changed files with 19 additions and 0 deletions
|
@ -79,6 +79,11 @@ struct ifreq {
|
|||
#define ifr_hwaddr ifr_ifru.ifru_hwaddr // MAC address
|
||||
};
|
||||
|
||||
struct if_nameindex {
|
||||
unsigned int if_index;
|
||||
char* if_name;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -21,3 +21,15 @@ char* if_indextoname([[maybe_unused]] unsigned int ifindex, [[maybe_unused]] cha
|
|||
errno = ENXIO;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/if_nameindex.html
|
||||
struct if_nameindex* if_nameindex()
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/if_freenameindex.html
|
||||
void if_freenameindex(struct if_nameindex*)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -12,5 +12,7 @@ __BEGIN_DECLS
|
|||
|
||||
unsigned int if_nametoindex(char const* ifname);
|
||||
char* if_indextoname(unsigned int ifindex, char* ifname);
|
||||
struct if_nameindex* if_nameindex();
|
||||
void if_freenameindex(struct if_nameindex* ptr);
|
||||
|
||||
__END_DECLS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue