2009-03-22 00:00:20 +08:00
|
|
|
/****************************************************************************
|
2012-03-04 07:18:34 +08:00
|
|
|
* include/netinet/arp.h
|
2009-03-22 00:00:20 +08:00
|
|
|
*
|
2020-02-01 04:23:15 +08:00
|
|
|
* Copyright (C) 2009, 2012, 2020 Gregory Nutt. All rights reserved.
|
2012-03-04 07:18:34 +08:00
|
|
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
2009-03-22 00:00:20 +08:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
* distribution.
|
|
|
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
* used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2012-03-04 07:18:34 +08:00
|
|
|
#ifndef __INCLUDE_NETINET_ARP_H
|
|
|
|
#define __INCLUDE_NETINET_ARP_H
|
2009-03-22 00:00:20 +08:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
2009-12-15 07:32:23 +08:00
|
|
|
|
|
|
|
#include <stdint.h>
|
2020-02-01 04:23:15 +08:00
|
|
|
#include <net/if.h>
|
|
|
|
|
2012-03-22 02:01:07 +08:00
|
|
|
#include <nuttx/fs/ioctl.h>
|
2009-03-22 00:00:20 +08:00
|
|
|
|
|
|
|
/****************************************************************************
|
2009-12-15 07:32:23 +08:00
|
|
|
* Pre-processor Definitions
|
2009-03-22 00:00:20 +08:00
|
|
|
****************************************************************************/
|
|
|
|
|
2020-02-01 02:09:01 +08:00
|
|
|
/* Three ioctls are available on all PF_INET sockets. Each ioctl takes a
|
|
|
|
* pointer to a 'struct arpreq' as its parameter.
|
2009-03-22 00:00:20 +08: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-13 01:37:04 +08: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-22 00:00:20 +08:00
|
|
|
|
2012-08-13 01:37:04 +08: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-22 00:00:20 +08:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Type Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* All ARP ioctls take a pointer to a struct arpreq as their parameter: */
|
|
|
|
|
|
|
|
struct arpreq
|
|
|
|
{
|
2009-12-15 07:32:23 +08: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-02-01 04:23:15 +08:00
|
|
|
uint8_t arp_dev[IFNAMSIZ + 1]; /* Device name (zero terminated) */
|
2009-03-22 00:00:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define EXTERN extern "C"
|
2015-06-13 09:26:01 +08:00
|
|
|
extern "C"
|
|
|
|
{
|
2009-03-22 00:00:20 +08:00
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-02-01 02:09:01 +08:00
|
|
|
#endif /* __INCLUDE_NETINET_ARP_H */
|