mirror of
https://github.com/digarok/gsplus.git
synced 2024-11-24 06:34:02 +00:00
rawnet - add rawnet_status() call to check if interface is open.
This commit is contained in:
parent
324c9a191f
commit
c4796f77ec
@ -76,4 +76,11 @@ char *rawnet_get_standard_interface(void)
|
||||
{
|
||||
return rawnet_arch_get_standard_interface();
|
||||
}
|
||||
|
||||
extern int rawnet_status(void)
|
||||
{
|
||||
return rawnet_arch_status();
|
||||
}
|
||||
|
||||
|
||||
#endif /* #ifdef HAVE_RAWNET */
|
||||
|
@ -72,4 +72,6 @@ extern int rawnet_enumadapter(char **ppname, char **ppdescription);
|
||||
extern int rawnet_enumadapter_close(void);
|
||||
extern char *rawnet_get_standard_interface(void);
|
||||
|
||||
extern int rawnet_status(void);
|
||||
|
||||
#endif
|
||||
|
@ -69,4 +69,6 @@ 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]);
|
||||
|
||||
extern int rawnet_arch_status(void);
|
||||
|
||||
#endif
|
||||
|
@ -498,3 +498,8 @@ int rawnet_arch_get_mac(uint8_t mac[6]) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int rawnet_arch_status(void) {
|
||||
return interface ? 1 : 0;
|
||||
}
|
||||
|
||||
|
@ -307,3 +307,7 @@ int rawnet_arch_get_mac(uint8_t mac[6]) {
|
||||
|
||||
}
|
||||
|
||||
int rawnet_arch_status(void) {
|
||||
return interface_fd >= 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
|
@ -543,4 +543,9 @@ extern int rawnet_arch_get_mac(uint8_t mac[6]) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int rawnet_arch_status(void) {
|
||||
return rawnet_pcap_fp ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
#endif /* #ifdef HAVE_RAWNET */
|
||||
|
@ -562,4 +562,9 @@ extern int rawnet_arch_get_mac(uint8_t mac[6]) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int rawnet_arch_status(void) {
|
||||
return EthernetPcapFP ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
#endif /* #ifdef HAVE_RAWNET */
|
||||
|
Loading…
Reference in New Issue
Block a user