Created
April 28, 2022 20:26
-
-
Save heatd/72b338f3e86e32c1dab40445ec17e150 to your computer and use it in GitHub Desktop.
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
struct netkernel_route4_add | |
{ | |
struct in_addr dest; | |
struct in_addr gateway; | |
struct in_addr mask; | |
}; | |
struct netkernel_route6_add | |
{ | |
struct in6_addr dest; | |
struct in6_addr gateway; | |
struct in6_addr mask; | |
}; | |
/** | |
* @brief Used to add a route to the routing table of a protocol | |
* | |
*/ | |
struct netkernel_add_route | |
{ | |
struct netkernel_hdr r_hdr; | |
int r_metric; | |
// Described in the INET_ROUTE_* flags | |
unsigned short r_flags; | |
uint32_t r_iface; | |
sa_family_t family; | |
union { | |
struct netkernel_route4_add inet; | |
struct netkernel_route6_add inet6; | |
} r_un; | |
}; | |
// Routed through a gateway - gateway field valid | |
#define INET_ROUTE_FLAG_GATEWAY (1 << 0) | |
// ?? | |
#define INET_ROUTE_FLAG_SCOPE_LOCAL (1 << 1) | |
// Multicast route | |
#define INET_ROUTE_FLAG_MULTICAST (1 << 2) | |
// Broadcast route | |
#define INET_ROUTE_FLAG_BROADCAST (1 << 3) | |
// Blackhole route - traffic is ignored | |
#define INET_ROUTE_FLAG_BLACKHOLE (1 << 4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment