2009-03-21 17:00:20 +01:00
|
|
|
/****************************************************************************
|
2012-03-04 00:18:34 +01:00
|
|
|
* include/netinet/arp.h
|
2009-03-21 17:00:20 +01:00
|
|
|
*
|
2021-02-03 11:33:49 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2009-03-21 17:00:20 +01:00
|
|
|
*
|
2021-02-03 11:33:49 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2009-03-21 17:00:20 +01:00
|
|
|
*
|
2021-02-03 11:33:49 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2009-03-21 17:00:20 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2012-03-04 00:18:34 +01:00
|
|
|
#ifndef __INCLUDE_NETINET_ARP_H
|
|
|
|
#define __INCLUDE_NETINET_ARP_H
|
2009-03-21 17:00:20 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
2009-12-15 00:32:23 +01:00
|
|
|
|
|
|
|
#include <stdint.h>
|
2020-01-31 21:23:15 +01:00
|
|
|
#include <net/if.h>
|
2023-04-13 17:37:40 +02:00
|
|
|
#include <net/if_arp.h>
|
2020-01-31 21:23:15 +01:00
|
|
|
|
2012-03-21 19:01:07 +01:00
|
|
|
#include <nuttx/fs/ioctl.h>
|
2009-03-21 17:00:20 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
2009-12-15 00:32:23 +01:00
|
|
|
* Pre-processor Definitions
|
2009-03-21 17:00:20 +01:00
|
|
|
****************************************************************************/
|
|
|
|
|
2020-01-31 19:09:01 +01:00
|
|
|
/* Three ioctls are available on all PF_INET sockets. Each ioctl takes a
|
|
|
|
* pointer to a 'struct arpreq' as its parameter.
|
2009-03-21 17:00:20 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define SIOCSARP _ARPIOC(1) /* Set a ARP mapping */
|
|
|
|
#define SIOCDARP _ARPIOC(2) /* Delete an ARP mapping */
|
|
|
|
#define SIOCGARP _ARPIOC(3) /* Get an ARP mapping */
|
|
|
|
|
2012-08-12 19:37:04 +02:00
|
|
|
/* Definitions for bits in field arp_flags of struct arpreq. If the
|
|
|
|
* ATF_NETMASK flag is set, then arp_netmask should be valid. This should
|
|
|
|
* be set to 0xffffffff, or 0 to remove an existing arp entry.
|
|
|
|
*/
|
2009-03-21 17:00:20 +01:00
|
|
|
|
2012-08-12 19:37:04 +02:00
|
|
|
#define ATF_COM (1 << 0) /* Lookup complete */
|
|
|
|
#define ATF_PERM (1 << 1) /* Permanent entry */
|
|
|
|
#define ATF_PUBL (1 << 2) /* Publish entry */
|
|
|
|
#define ATF_USETRAILERS (1 << 3) /* Trailers requested (obsolete) */
|
|
|
|
#define ATF_NETMASK (1 << 4) /* Use a netmask */
|
|
|
|
#define ATF_DONTPUB (1 << 5) /* Don't answer */
|
2009-03-21 17:00:20 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Type Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* All ARP ioctls take a pointer to a struct arpreq as their parameter: */
|
|
|
|
|
|
|
|
struct arpreq
|
|
|
|
{
|
2021-02-03 09:42:38 +01:00
|
|
|
struct sockaddr arp_pa; /* Protocol address */
|
|
|
|
struct sockaddr arp_ha; /* Hardware address */
|
|
|
|
struct sockaddr arp_netmask; /* Netmask of protocol address */
|
|
|
|
uint8_t arp_flags; /* Flags */
|
2020-01-31 21:23:15 +01:00
|
|
|
uint8_t arp_dev[IFNAMSIZ + 1]; /* Device name (zero terminated) */
|
2009-03-21 17:00:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define EXTERN extern "C"
|
2015-06-13 03:26:01 +02:00
|
|
|
extern "C"
|
|
|
|
{
|
2009-03-21 17:00:20 +01:00
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-01-31 19:09:01 +01:00
|
|
|
#endif /* __INCLUDE_NETINET_ARP_H */
|