SNMP agent attached to SPI slave

Dependencies:   mbed

Committer:
lorcansmith
Date:
Mon Aug 13 15:07:40 2012 +0000
Revision:
0:2a53a4c3238c
v1.1 release includes ioAlarm traps

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lorcansmith 0:2a53a4c3238c 1 /*
lorcansmith 0:2a53a4c3238c 2 * Redistribution and use in source and binary forms, with or without modification,
lorcansmith 0:2a53a4c3238c 3 * are permitted provided that the following conditions are met:
lorcansmith 0:2a53a4c3238c 4 *
lorcansmith 0:2a53a4c3238c 5 * 1. Redistributions of source code must retain the above copyright notice,
lorcansmith 0:2a53a4c3238c 6 * this list of conditions and the following disclaimer.
lorcansmith 0:2a53a4c3238c 7 * 2. Redistributions in binary form must reproduce the above copyright notice,
lorcansmith 0:2a53a4c3238c 8 * this list of conditions and the following disclaimer in the documentation
lorcansmith 0:2a53a4c3238c 9 * and/or other materials provided with the distribution.
lorcansmith 0:2a53a4c3238c 10 * 3. The name of the author may not be used to endorse or promote products
lorcansmith 0:2a53a4c3238c 11 * derived from this software without specific prior written permission.
lorcansmith 0:2a53a4c3238c 12 *
lorcansmith 0:2a53a4c3238c 13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
lorcansmith 0:2a53a4c3238c 14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
lorcansmith 0:2a53a4c3238c 15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
lorcansmith 0:2a53a4c3238c 16 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
lorcansmith 0:2a53a4c3238c 17 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
lorcansmith 0:2a53a4c3238c 18 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
lorcansmith 0:2a53a4c3238c 19 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
lorcansmith 0:2a53a4c3238c 20 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
lorcansmith 0:2a53a4c3238c 21 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
lorcansmith 0:2a53a4c3238c 22 * OF SUCH DAMAGE.
lorcansmith 0:2a53a4c3238c 23 *
lorcansmith 0:2a53a4c3238c 24 * This file is part of the lwIP TCP/IP stack.
lorcansmith 0:2a53a4c3238c 25 *
lorcansmith 0:2a53a4c3238c 26 * Author: Simon Goldschmidt
lorcansmith 0:2a53a4c3238c 27 *
lorcansmith 0:2a53a4c3238c 28 */
lorcansmith 0:2a53a4c3238c 29 #ifndef __LWIP_NETDB_H__
lorcansmith 0:2a53a4c3238c 30 #define __LWIP_NETDB_H__
lorcansmith 0:2a53a4c3238c 31
lorcansmith 0:2a53a4c3238c 32 #include "lwip/opt.h"
lorcansmith 0:2a53a4c3238c 33
lorcansmith 0:2a53a4c3238c 34 #if LWIP_DNS && LWIP_SOCKET
lorcansmith 0:2a53a4c3238c 35
lorcansmith 0:2a53a4c3238c 36 #include <stddef.h> /* for size_t */
lorcansmith 0:2a53a4c3238c 37
lorcansmith 0:2a53a4c3238c 38 #include "lwip/inet.h"
lorcansmith 0:2a53a4c3238c 39 #include "lwip/sockets.h"
lorcansmith 0:2a53a4c3238c 40
lorcansmith 0:2a53a4c3238c 41 /* some rarely used options */
lorcansmith 0:2a53a4c3238c 42 #ifndef LWIP_DNS_API_DECLARE_H_ERRNO
lorcansmith 0:2a53a4c3238c 43 #define LWIP_DNS_API_DECLARE_H_ERRNO 1
lorcansmith 0:2a53a4c3238c 44 #endif
lorcansmith 0:2a53a4c3238c 45
lorcansmith 0:2a53a4c3238c 46 #ifndef LWIP_DNS_API_DEFINE_ERRORS
lorcansmith 0:2a53a4c3238c 47 #define LWIP_DNS_API_DEFINE_ERRORS 1
lorcansmith 0:2a53a4c3238c 48 #endif
lorcansmith 0:2a53a4c3238c 49
lorcansmith 0:2a53a4c3238c 50 #ifndef LWIP_DNS_API_DECLARE_STRUCTS
lorcansmith 0:2a53a4c3238c 51 #define LWIP_DNS_API_DECLARE_STRUCTS 1
lorcansmith 0:2a53a4c3238c 52 #endif
lorcansmith 0:2a53a4c3238c 53
lorcansmith 0:2a53a4c3238c 54 #if LWIP_DNS_API_DEFINE_ERRORS
lorcansmith 0:2a53a4c3238c 55 /** Errors used by the DNS API functions, h_errno can be one of them */
lorcansmith 0:2a53a4c3238c 56 #define EAI_NONAME 200
lorcansmith 0:2a53a4c3238c 57 #define EAI_SERVICE 201
lorcansmith 0:2a53a4c3238c 58 #define EAI_FAIL 202
lorcansmith 0:2a53a4c3238c 59 #define EAI_MEMORY 203
lorcansmith 0:2a53a4c3238c 60
lorcansmith 0:2a53a4c3238c 61 #define HOST_NOT_FOUND 210
lorcansmith 0:2a53a4c3238c 62 #define NO_DATA 211
lorcansmith 0:2a53a4c3238c 63 #define NO_RECOVERY 212
lorcansmith 0:2a53a4c3238c 64 #define TRY_AGAIN 213
lorcansmith 0:2a53a4c3238c 65 #endif /* LWIP_DNS_API_DEFINE_ERRORS */
lorcansmith 0:2a53a4c3238c 66
lorcansmith 0:2a53a4c3238c 67 #if LWIP_DNS_API_DECLARE_STRUCTS
lorcansmith 0:2a53a4c3238c 68 struct hostent {
lorcansmith 0:2a53a4c3238c 69 char *h_name; /* Official name of the host. */
lorcansmith 0:2a53a4c3238c 70 char **h_aliases; /* A pointer to an array of pointers to alternative host names,
lorcansmith 0:2a53a4c3238c 71 terminated by a null pointer. */
lorcansmith 0:2a53a4c3238c 72 int h_addrtype; /* Address type. */
lorcansmith 0:2a53a4c3238c 73 int h_length; /* The length, in bytes, of the address. */
lorcansmith 0:2a53a4c3238c 74 char **h_addr_list; /* A pointer to an array of pointers to network addresses (in
lorcansmith 0:2a53a4c3238c 75 network byte order) for the host, terminated by a null pointer. */
lorcansmith 0:2a53a4c3238c 76 #define h_addr h_addr_list[0] /* for backward compatibility */
lorcansmith 0:2a53a4c3238c 77 };
lorcansmith 0:2a53a4c3238c 78
lorcansmith 0:2a53a4c3238c 79 struct addrinfo {
lorcansmith 0:2a53a4c3238c 80 int ai_flags; /* Input flags. */
lorcansmith 0:2a53a4c3238c 81 int ai_family; /* Address family of socket. */
lorcansmith 0:2a53a4c3238c 82 int ai_socktype; /* Socket type. */
lorcansmith 0:2a53a4c3238c 83 int ai_protocol; /* Protocol of socket. */
lorcansmith 0:2a53a4c3238c 84 socklen_t ai_addrlen; /* Length of socket address. */
lorcansmith 0:2a53a4c3238c 85 struct sockaddr *ai_addr; /* Socket address of socket. */
lorcansmith 0:2a53a4c3238c 86 char *ai_canonname; /* Canonical name of service location. */
lorcansmith 0:2a53a4c3238c 87 struct addrinfo *ai_next; /* Pointer to next in list. */
lorcansmith 0:2a53a4c3238c 88 };
lorcansmith 0:2a53a4c3238c 89 #endif /* LWIP_DNS_API_DECLARE_STRUCTS */
lorcansmith 0:2a53a4c3238c 90
lorcansmith 0:2a53a4c3238c 91 #if LWIP_DNS_API_DECLARE_H_ERRNO
lorcansmith 0:2a53a4c3238c 92 /* application accessable error code set by the DNS API functions */
lorcansmith 0:2a53a4c3238c 93 extern int h_errno;
lorcansmith 0:2a53a4c3238c 94 #endif /* LWIP_DNS_API_DECLARE_H_ERRNO*/
lorcansmith 0:2a53a4c3238c 95
lorcansmith 0:2a53a4c3238c 96 struct hostent *lwip_gethostbyname(const char *name);
lorcansmith 0:2a53a4c3238c 97 int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
lorcansmith 0:2a53a4c3238c 98 size_t buflen, struct hostent **result, int *h_errnop);
lorcansmith 0:2a53a4c3238c 99 void lwip_freeaddrinfo(struct addrinfo *ai);
lorcansmith 0:2a53a4c3238c 100 int lwip_getaddrinfo(const char *nodename,
lorcansmith 0:2a53a4c3238c 101 const char *servname,
lorcansmith 0:2a53a4c3238c 102 const struct addrinfo *hints,
lorcansmith 0:2a53a4c3238c 103 struct addrinfo **res);
lorcansmith 0:2a53a4c3238c 104
lorcansmith 0:2a53a4c3238c 105 #if LWIP_COMPAT_SOCKETS
lorcansmith 0:2a53a4c3238c 106 #define gethostbyname(name) lwip_gethostbyname(name)
lorcansmith 0:2a53a4c3238c 107 #define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \
lorcansmith 0:2a53a4c3238c 108 lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop)
lorcansmith 0:2a53a4c3238c 109 #define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo)
lorcansmith 0:2a53a4c3238c 110 #define getaddrinfo(nodname, servname, hints, res) \
lorcansmith 0:2a53a4c3238c 111 lwip_getaddrinfo(nodname, servname, hints, res)
lorcansmith 0:2a53a4c3238c 112 #endif /* LWIP_COMPAT_SOCKETS */
lorcansmith 0:2a53a4c3238c 113
lorcansmith 0:2a53a4c3238c 114 #endif /* LWIP_DNS && LWIP_SOCKET */
lorcansmith 0:2a53a4c3238c 115
lorcansmith 0:2a53a4c3238c 116 #endif /* __LWIP_NETDB_H__ */