[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #8021] Add INET[6]_ADDRSTRLEN Preprocessor Definitio
From: |
Grant Erickson |
Subject: |
[lwip-devel] [patch #8021] Add INET[6]_ADDRSTRLEN Preprocessor Definitions If Not Previously Defined |
Date: |
Tue, 16 Apr 2013 16:08:16 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.28.10 (KHTML, like Gecko) Version/6.0.3 Safari/536.28.10 |
URL:
<http://savannah.nongnu.org/patch/?8021>
Summary: Add INET[6]_ADDRSTRLEN Preprocessor Definitions If
Not Previously Defined
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: marathon96
Submitted on: Tue 16 Apr 2013 04:08:15 PM GMT
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
>From c7126867b6798409b6a3e7ab2032d27376ef8a95 Mon Sep 17 00:00:00 2001
From: Grant Erickson <address@hidden>
Date: Tue, 16 Apr 2013 09:05:40 -0700
Subject: [PATCH] ipv4/ipv6: add INET[6]_ADDRSTRLEN if not defined
Add INET[6]_ADDRSTRLEN preprocessor definitions, if not
already defined.
---
src/include/ipv4/lwip/ip4_addr.h | 7 +++++++
src/include/ipv6/lwip/ip6_addr.h | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/src/include/ipv4/lwip/ip4_addr.h
b/src/include/ipv4/lwip/ip4_addr.h
index b05ae53..8d65703 100644
--- a/src/include/ipv4/lwip/ip4_addr.h
+++ b/src/include/ipv4/lwip/ip4_addr.h
@@ -228,6 +228,13 @@ u8_t ip4_addr_netmask_valid(u32_t netmask);
#define ip4_addr3_16(ipaddr) ((u16_t)ip4_addr3(ipaddr))
#define ip4_addr4_16(ipaddr) ((u16_t)ip4_addr4(ipaddr))
+#define IP4ADDR_STRLEN_MAX 16
+#define IPADDR_STRLEN_MAX IP4ADDR_STRLEN_MAX
+
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN IP4ADDR_STRLEN_MAX
+#endif
+
/** For backwards compatibility */
#define ip_ntoa(ipaddr) ipaddr_ntoa(ipaddr)
diff --git a/src/include/ipv6/lwip/ip6_addr.h
b/src/include/ipv6/lwip/ip6_addr.h
index 7ac4856..f8ffc7c 100644
--- a/src/include/ipv6/lwip/ip6_addr.h
+++ b/src/include/ipv6/lwip/ip6_addr.h
@@ -275,6 +275,12 @@ Little-endian version, stored in network order (no
htonl). */
ipaddr != NULL ? IP6_ADDR_BLOCK7(ipaddr) : 0, \
ipaddr != NULL ? IP6_ADDR_BLOCK8(ipaddr) : 0))
+#define IP6ADDR_STRLEN_MAX 46
+
+#ifndef INET6_ADDRSTRLEN
+#define INET6_ADDRSTRLEN IP6ADDR_STRLEN_MAX
+#endif
+
int ip6addr_aton(const char *cp, ip6_addr_t *addr);
/** returns ptr to static buffer; not reentrant! */
char *ip6addr_ntoa(const ip6_addr_t *addr);
--
1.8.1.1
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Tue 16 Apr 2013 04:08:15 PM GMT Name: lwip-0002.1.patch Size: 2kB
By: marathon96
<http://savannah.nongnu.org/patch/download.php?file_id=27892>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?8021>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-devel] [patch #8021] Add INET[6]_ADDRSTRLEN Preprocessor Definitions If Not Previously Defined,
Grant Erickson <=