MTU config
parent
c24e624229
commit
903c9df4e1
10
if_helper.c
10
if_helper.c
|
|
@ -24,6 +24,16 @@ int if_down(char *name) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int if_mtu(char *name, int mtu) {
|
||||||
|
char buf[128];
|
||||||
|
snprintf(buf, sizeof(buf), "ifconfig %s mtu %d", name, mtu);
|
||||||
|
int ret = system(buf);
|
||||||
|
if (ret != 0) {
|
||||||
|
printf("Could set MTU for interface %s\n", name);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int if_enable_ibss(char *name) {
|
int if_enable_ibss(char *name) {
|
||||||
char buf[128];
|
char buf[128];
|
||||||
snprintf(buf, sizeof(buf), "iw %s set type ibss", name);
|
snprintf(buf, sizeof(buf), "iw %s set type ibss", name);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
int if_up(char *name);
|
int if_up(char *name);
|
||||||
int if_down(char *name);
|
int if_down(char *name);
|
||||||
|
int if_mtu(char *name, int mtu);
|
||||||
int if_promisc(char *name);
|
int if_promisc(char *name);
|
||||||
int if_enable_ibss(char *name);
|
int if_enable_ibss(char *name);
|
||||||
int if_join_ibss(char *name, char *essid, int frequency);
|
int if_join_ibss(char *name, char *essid, int frequency);
|
||||||
3
main.c
3
main.c
|
|
@ -40,7 +40,7 @@ int domainSocket;
|
||||||
#define PROTOCOL_IDENTIFIER 0x9f77
|
#define PROTOCOL_IDENTIFIER 0x9f77
|
||||||
|
|
||||||
// Max payload length
|
// Max payload length
|
||||||
#define PAYLOAD_LENGTH 4096
|
#define PAYLOAD_LENGTH 1500
|
||||||
|
|
||||||
// ESSID and frequency for network
|
// ESSID and frequency for network
|
||||||
#define ESSID "WiPacket"
|
#define ESSID "WiPacket"
|
||||||
|
|
@ -358,6 +358,7 @@ void configureInterface() {
|
||||||
if_down(if_name);
|
if_down(if_name);
|
||||||
if_enable_ibss(if_name);
|
if_enable_ibss(if_name);
|
||||||
if_up(if_name);
|
if_up(if_name);
|
||||||
|
if_mtu(if_name, PAYLOAD_LENGTH);
|
||||||
if_join_ibss(if_name, essid, frequency);
|
if_join_ibss(if_name, essid, frequency);
|
||||||
if_promisc(if_name);
|
if_promisc(if_name);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue