mirror of
https://github.com/ep00ch/lwip-contrib-mac.git
synced 2024-09-27 11:56:39 +00:00
Win32 pcapif.c: fix C coding style, include lwipcfg_msvc.h as first file so that it can set _CRT_SECURE_NO_WARNINGS for MSVC
This commit is contained in:
parent
efb6f0bdb4
commit
b19fd7d218
@ -34,6 +34,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* include the port-dependent configuration */
|
||||
#include "lwipcfg_msvc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@ -69,9 +72,6 @@
|
||||
|
||||
#include "netif/etharp.h"
|
||||
|
||||
/* include the port-dependent configuration */
|
||||
#include "lwipcfg_msvc.h"
|
||||
|
||||
/* For compatibility with old pcap */
|
||||
#ifndef PCAP_OPENFLAG_PROMISCUOUS
|
||||
#define PCAP_OPENFLAG_PROMISCUOUS 1
|
||||
@ -479,6 +479,11 @@ pcapif_low_level_init(struct netif *netif)
|
||||
u8_t my_mac_addr[ETHARP_HWADDR_LEN] = LWIP_MAC_ADDR_BASE;
|
||||
int adapter_num = PACKET_LIB_ADAPTER_NR;
|
||||
struct pcapif_private *pa;
|
||||
#ifdef PACKET_LIB_GET_ADAPTER_NETADDRESS
|
||||
ip_addr_t netaddr;
|
||||
#define GUID_LEN 128
|
||||
char guid[GUID_LEN + 1];
|
||||
#endif /* PACKET_LIB_GET_ADAPTER_NETADDRESS */
|
||||
|
||||
/* If 'state' is != NULL at this point, we assume it is an 'int' giving
|
||||
the index of the adapter to use (+ 1 because 0==NULL is invalid).
|
||||
@ -493,9 +498,6 @@ pcapif_low_level_init(struct netif *netif)
|
||||
}
|
||||
|
||||
#ifdef PACKET_LIB_GET_ADAPTER_NETADDRESS
|
||||
ip_addr_t netaddr;
|
||||
#define GUID_LEN 128
|
||||
char guid[GUID_LEN + 1];
|
||||
memset(&guid, 0, sizeof(guid));
|
||||
PACKET_LIB_GET_ADAPTER_NETADDRESS(&netaddr);
|
||||
if (get_adapter_index_from_addr((struct in_addr *)&netaddr, guid, GUID_LEN) < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user