This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kernel/libc: Add some network/route ioctl stuff
- Loading branch information
Showing
7 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* SPDX-License-Identifier: GPL-3.0-or-later */ | ||
/* Copyright © 2016-2024 Byteduck */ | ||
|
||
#pragma once | ||
|
||
#include "socket.h" | ||
#include "net.h" | ||
|
||
__DECL_BEGIN | ||
|
||
struct ifreq { | ||
char ifr_name[IFNAMSIZ]; | ||
union { | ||
struct sockaddr ifr_addr; | ||
struct sockaddr ifr_dstaddr; | ||
struct sockaddr ifr_broadaddr; | ||
struct sockaddr ifr_netmask; | ||
struct sockaddr ifr_hwaddr; | ||
short ifr_flags; | ||
int ifr_ifindex; | ||
int ifr_metric; | ||
int ifr_mtu; | ||
char ifr_slave[IFNAMSIZ]; | ||
char ifr_newname[IFNAMSIZ]; | ||
char *ifr_data; | ||
}; | ||
}; | ||
|
||
__DECL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
#include "ipv4.h" | ||
|
||
#define IFNAMESIZ 16 | ||
#define IFNAMSIZ IFNAMESIZ | ||
|
||
__DECL_BEGIN | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* SPDX-License-Identifier: GPL-3.0-or-later */ | ||
/* Copyright © 2016-2024 Byteduck */ | ||
|
||
#pragma once | ||
|
||
#include "net.h" | ||
|
||
__DECL_BEGIN | ||
|
||
struct rtentry { | ||
struct sockaddr rt_dst; | ||
struct sockaddr rt_gateway; | ||
struct sockaddr rt_genmask; | ||
unsigned short rt_flags; | ||
unsigned short rt_metric; | ||
char* rt_dev; | ||
long rt_mtu; | ||
long rt_window; | ||
long rt_irtt; | ||
}; | ||
|
||
// Flags | ||
#define RTF_UP 0x1 | ||
#define RTF_GATEWAY 0x2 | ||
|
||
__DECL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* SPDX-License-Identifier: GPL-3.0-or-later */ | ||
/* Copyright © 2016-2024 Byteduck */ | ||
|
||
#pragma once | ||
#include <kernel/api/if.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* SPDX-License-Identifier: GPL-3.0-or-later */ | ||
/* Copyright © 2016-2024 Byteduck */ | ||
|
||
#pragma once | ||
|
||
#include <kernel/api/route.h> |