mirror of
https://github.com/digarok/gsplus.git
synced 2024-11-28 04:49:18 +00:00
rawnet - add functions to get mac and mtu, if known.
This commit is contained in:
parent
f550249382
commit
9370ed8604
@ -65,4 +65,8 @@ extern int rawnet_arch_enumadapter_close(void);
|
|||||||
|
|
||||||
extern char *rawnet_arch_get_standard_interface(void);
|
extern char *rawnet_arch_get_standard_interface(void);
|
||||||
|
|
||||||
|
|
||||||
|
extern int rawnet_arch_get_mtu(void);
|
||||||
|
extern int rawnet_arch_get_mac(uint8_t mac[6]);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -268,3 +268,16 @@ int rawnet_arch_enumadapter_close(void) {
|
|||||||
char *rawnet_arch_get_standard_interface(void) {
|
char *rawnet_arch_get_standard_interface(void) {
|
||||||
return lib_stralloc("vmnet");
|
return lib_stralloc("vmnet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int rawnet_arch_get_mtu(void) {
|
||||||
|
return interface ? interface_mtu : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int rawnet_arch_get_mac(uint8_t mac[6]) {
|
||||||
|
if (interface) {
|
||||||
|
memcpy(mac, interface_mac, 6);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -535,4 +535,12 @@ char *rawnet_arch_get_standard_interface(void)
|
|||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int rawnet_arch_get_mtu(void) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern int rawnet_arch_get_mac(uint8_t mac[6]) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* #ifdef HAVE_RAWNET */
|
#endif /* #ifdef HAVE_RAWNET */
|
||||||
|
@ -539,4 +539,13 @@ char *rawnet_arch_get_standard_interface(void)
|
|||||||
|
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int rawnet_arch_get_mtu(void) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern int rawnet_arch_get_mac(uint8_t mac[6]) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* #ifdef HAVE_RAWNET */
|
#endif /* #ifdef HAVE_RAWNET */
|
||||||
|
Loading…
Reference in New Issue
Block a user