diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-21 16:00:20 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-21 16:00:20 +0000 |
commit | 6f33910a3b092e057e3e066603837784cd41b4e2 (patch) | |
tree | 9eb3a98ea84ce5b3f1c417eee5da66aa6f3747de /nuttx/include/netinet | |
parent | 8c195a6502ab171dde27aa23ba9251079e18d3ac (diff) | |
download | px4-nuttx-6f33910a3b092e057e3e066603837784cd41b4e2.tar.gz px4-nuttx-6f33910a3b092e057e3e066603837784cd41b4e2.tar.bz2 px4-nuttx-6f33910a3b092e057e3e066603837784cd41b4e2.zip |
Expose more ARP APIs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1633 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/netinet')
-rw-r--r-- | nuttx/include/netinet/arp.h | 110 | ||||
-rw-r--r-- | nuttx/include/netinet/ether.h | 8 | ||||
-rw-r--r-- | nuttx/include/netinet/ip6.h | 4 |
3 files changed, 116 insertions, 6 deletions
diff --git a/nuttx/include/netinet/arp.h b/nuttx/include/netinet/arp.h new file mode 100644 index 000000000..908f5790a --- /dev/null +++ b/nuttx/include/netinet/arp.h @@ -0,0 +1,110 @@ +/**************************************************************************** + * netinet/arp.h + * + * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * + * 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. + * + ****************************************************************************/ + +#ifndef __NETINET_ARP_H +#define __NETINET_ARP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> +#include <sys/types.h> +#include <nuttx/ioctl.h> + +/**************************************************************************** + * Public Definitions + ****************************************************************************/ + +/* Three ioctls are available on all PF_INET sockets, but only if the NuttX + * configuration CONFIG_NET_ARPIOCTLS is defined. Each ioctl takes a pointer + * to a 'struct arpreq' as its parameter. + */ + +#define SIOCSARP _ARPIOC(1) /* Set a ARP mapping */ +#define SIOCDARP _ARPIOC(2) /* Delete an ARP mapping */ +#define SIOCGARP _ARPIOC(3) /* Get an ARP mapping */ + +/* Values for the FLAGS field in struct arpreq */ + +#define ATF_COM 0x01 /* Lookup complete */ +#define ATF_PERM 0x02 /* Permanent entry */ +#define ATF_PUBL 0x04 /* Publish entry */ +#define ATF_USETRAILERS 0x10 /* Trailers requested */ +#define ATF_NETMASK 0x20 /* Use a netmask */ +#define ATF_DONTPUB 0x40 /* Don't answer */ + +/**************************************************************************** + * Public Type Definitions + ****************************************************************************/ + +/* All ARP ioctls take a pointer to a struct arpreq as their parameter: */ + +struct arpreq +{ + struct sockaddr arp_pa; /* Protocol address */ + struct sockaddr arp_ha; /* Hardware address */ + struct sockaddr arp_netmask; /* Netmask of protocol address */ + ubyte arp_flags; /* Flags */ + ubyte arp_dev[IFNAMSIZ+1]; /* Device name (zero terminated)*/ +}; + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/* If CONFIG_NET_ARPIOCTLS is defined then the semi-standard ioctl commands + * described above are supported. If not, you can call the uIP ARP interfaces + * directly in a very non-standard way. See include/net/uip/uip-arp.h for + * prototypes. + */ + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __NETINET_ARP_H */ diff --git a/nuttx/include/netinet/ether.h b/nuttx/include/netinet/ether.h index 335fd56bf..3cd2d3ad4 100644 --- a/nuttx/include/netinet/ether.h +++ b/nuttx/include/netinet/ether.h @@ -1,7 +1,7 @@ /**************************************************************************** * netinet/ether.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 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. * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __NETINET_ETHER_H -#define __NETINET_ETHER_H +#ifndef __NETINET_ETHER_H +#define __NETINET_ETHER_H /**************************************************************************** * Included Files diff --git a/nuttx/include/netinet/ip6.h b/nuttx/include/netinet/ip6.h index cc6a5295c..c8c0e22e3 100644 --- a/nuttx/include/netinet/ip6.h +++ b/nuttx/include/netinet/ip6.h @@ -1,7 +1,7 @@ /**************************************************************************** * netinet/ip6.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 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. * |