-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.h
43 lines (36 loc) · 895 Bytes
/
interface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// interface.h
// router
//
// Created by Peera Yoodee on 9/24/15.
//
#ifndef __router__interface__
#define __router__interface__
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <ifaddrs.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <linux/if_ether.h>
#include <net/if.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include "utils.h"
struct interface {
char interface_name[16];
short interface_index;
u_char interface_macaddress[6];
uint32_t interface_ipaddress;
uint32_t interface_netmask;
uint32_t interface_netaddress;
int sockfd;
};
//void print_interfaces();
void fill_interface_info(struct interface *inf);
void fprintf_interface(FILE *out, struct interface *intf);
#endif /* defined(__router__interface__) */