socket: SIOCADDRT ioctl

This commit is contained in:
Matheus
2024-04-07 21:44:07 -03:00
parent 989621840e
commit bba08c0b3e
3 changed files with 71 additions and 3 deletions
+20 -1
View File
@@ -94,7 +94,7 @@ typedef struct {
typedef struct {
unsigned short type;
char addr[];
char addr[14];
} abisockaddr_t;
typedef struct {
@@ -129,6 +129,7 @@ typedef struct {
#define IFNAMSIZ 16
#define SIOCGIFHWADDR 0x8927
#define SIOCADDRT 0x890b
typedef struct {
char name[IFNAMSIZ];
@@ -137,4 +138,22 @@ typedef struct {
};
} ifreq_t;
typedef struct {
unsigned long int rt_pad1;
abisockaddr_t rt_dst;
abisockaddr_t rt_gateway;
abisockaddr_t rt_genmask;
unsigned short int rt_flags;
short int rt_pad2;
unsigned long int rt_pad3;
unsigned char rt_tos;
unsigned char rt_class;
short int rt_pad4[3];
short int rt_metric;
char *rt_dev;
unsigned long int rt_mtu;
unsigned long int rt_window;
unsigned short int rt_irtt;
} abirtentry_t;
#endif