if_arp: add arphdr definition

adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2023-04-13 23:37:40 +08:00
committed by Xiang Xiao
parent 586c89b754
commit fc0ecd4e9e
2 changed files with 136 additions and 16 deletions
+1 -16
View File
@@ -29,6 +29,7 @@
#include <stdint.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <nuttx/fs/ioctl.h>
@@ -36,22 +37,6 @@
* Pre-processor Definitions
****************************************************************************/
/* ARP protocol HARDWARE identifiers. Provided as the sa_family member of a
* struct sockaddr.
*
* When sa_family is ARPHRD_ETHER, the 6 byte Ethernet address is provided
* in the first 6-bytes of the sockaddr sa_data array.
*/
#define ARPHRD_ETHER 1 /* Ethernet */
#define ARPHRD_PPP 512
#define ARPHRD_LOOPBACK 772 /* Loopback device */
#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
#define ARPHRD_IEEE802154 804 /* IEEE 802.15.4 */
#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
#define ARPHRD_NONE 0xFFFE /* zero header length */
/* Three ioctls are available on all PF_INET sockets. Each ioctl takes a
* pointer to a 'struct arpreq' as its parameter.
*/