[lwip-users] SO_BINDTODEVICE Support

2016-12-19 Thread Aditya Prakash
Hi,

I ran into this thread from 2011 http://savannah.nongnu.org/bugs/?33128,

I was wondering if there are any plans to to implement this feature. As I
have a device with multiple interfaces and it would be great if this
feature is implemented in LwIP code itself, rather than implementing it on
my side, and modifying the same for every update.

Thanks & Regards,
Aditya Prakash
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

[lwip-users] LWIP : Get rid of warnings when LWIP_NOASSERT is on

2016-12-19 Thread Nirav Desai
?Hello,

I use LWIP in professional capacity.

Here I face a common warning due ot a varialble defined in file viz. pbuf.c

When LWIP Asserts  are off compilation warning is seen.


Please find attached a patch which helps get rid of this warning.

Please let me know if this can be pulled in man stream.




Thanks & Best Regards,
Nirav
LWIP: Get rid of build warnings when LWIP asserts are off

When user set LWIP_NOASSERT to 1 build warnings are seen
for unused variable "err"
---
 src/core/pbuf.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/core/pbuf.c b/src/core/pbuf.c
index 14dfb72..4b2ae44 100644
--- a/src/core/pbuf.c
+++ b/src/core/pbuf.c
@@ -1167,7 +1167,9 @@ struct pbuf*
 pbuf_coalesce(struct pbuf *p, pbuf_layer layer)
 {
   struct pbuf *q;
+#ifndef LWIP_NOASSERT
   err_t err;
+#endif
   if (p->next == NULL) {
 return p;
   }
@@ -1176,8 +1178,12 @@ pbuf_coalesce(struct pbuf *p, pbuf_layer layer)
 /* @todo: what do we do now? */
 return p;
   }
+#ifndef LWIP_NOASSERT
   err = pbuf_copy(q, p);
   LWIP_ASSERT("pbuf_copy failed", err == ERR_OK);
+#else
+  pbuf_copy(q, p);
+#endif
   pbuf_free(p);
   return q;
 }
-- 
2.7.4

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] LWIP : Get rid of warnings when LWIP_NOASSERT is on

2016-12-19 Thread Simon Goldschmidt
adityapr wrote:
> Since we are already at this issue, there are a couple of warnings that I
> would also like to report.

Reporting errors is best done via https://savannah.nongnu.org/bugs/?group=lwip 
or at least by putting a full compiler error into the mail (instead of 
re-phrasing a problem with your own words).

> Sent from the lwip-users mailing list archive at Nabble.com.

Why don't users subscribe to mailing lists? We're *not* driven by nabble! In 
fact, I hate this site: as list admin, I keep getting mails to accept mails to 
this list from unsubscribed users, just because they are too bored of using 
email vs. nabble...

Simon

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users


Re: [lwip-users] LWIP : Get rid of warnings when LWIP_NOASSERT is on

2016-12-19 Thread Dirk Ziegelmeier
Thank you for reporting. I found three more places in IPv6 code to fix.


Ciao
Dirk

--
Dirk Ziegelmeier * d...@ziegelmeier.net * http://www.ziegelmeier.net

On Mon, Dec 19, 2016 at 9:48 AM, Nirav Desai  wrote:

> ​Hello,
>
> I use LWIP in professional capacity.
>
> Here I face a common warning due ot a varialble defined in file viz.
> pbuf.c
>
> When LWIP Asserts  are off compilation warning is seen.
>
>
> Please find attached a patch which helps get rid of this warning.
>
> Please let me know if this can be pulled in man stream.
>
>
>
>
> Thanks & Best Regards,
> Nirav
>
> ___
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] LWIP : Get rid of warnings when LWIP_NOASSERT is on

2016-12-19 Thread Dirk Ziegelmeier
I don't get these warnings on any compiler that I use (gcc linux,
arm-none-eabi-gcc, clang, VS2010) and the code looks OK to me.

Since all parentheses you added are around arguments passed to
lwip_htons(), I suspect you may have overridden this macro and the problem
is somewhere in its definition?

Dirk

--
Dirk Ziegelmeier * d...@ziegelmeier.net * http://www.ziegelmeier.net

On Mon, Dec 19, 2016 at 9:00 AM, adityapr  wrote:

> Hi Dirk,
>
> Since we are already at this issue, there are a couple of warnings that I
> would also like to report.
> In tcp.h:
>  - #define TCPH_HDRLEN_FLAGS_SET(phdr, len, flags)
> (phdr)->_hdrlen_rsvd_flags = htons(((len) << 12) | (flags))
> + #define TCPH_HDRLEN_FLAGS_SET(phdr, len, flags)
> (phdr)->_hdrlen_rsvd_flags
> = htonslen) << 12) | (flags)))
> and in tcp_out.c
> - TCPH_FLAGS_SET(tcphdr, TCP_ACK | TCP_FIN);
> +TCPH_FLAGS_SET(tcphdr, ((TCP_ACK) | (TCP_FIN)));
>
> These lines give warning for parenthesis in arm-none-eabi-gcc compiler. It
> would be nice if these warnings are fixed with those as well.
>
> Regards
> Aditya
>
>
>
> --
> View this message in context: http://lwip.100.n7.nabble.com/
> LWIP-Get-rid-of-warnings-when-LWIP-NOASSERT-is-on-tp28201p28205.html
> Sent from the lwip-users mailing list archive at Nabble.com.
>
> ___
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] LWIP : Get rid of warnings when LWIP_NOASSERT is on

2016-12-19 Thread contact
You can add a simpler statement in such case:

#ifndef LWIP_NOASSERT
(void)err;
#endif

Regards,
Ajay Bhargav
www.8051projects.net

From: Nirav Desai
Sent: Monday, December 19, 2016 2:29 PM
To: lwip-de...@nongnu.org
Cc: lwip-users@nongnu.org
Subject: [lwip-users] LWIP : Get rid of warnings when LWIP_NOASSERT is on

​Hello,
I use LWIP in professional capacity.
Here I face a common warning due ot a varialble defined in file viz. pbuf.c 
When LWIP Asserts  are off compilation warning is seen.

Please find attached a patch which helps get rid of this warning.
Please let me know if this can be pulled in man stream.



Thanks & Best Regards,
Nirav

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

[lwip-users] FreeRTOs port

2016-12-19 Thread Nirav Desai
Hello All,

Please find attached a patch which has FreeRTOS port for LWIP.

Many IoT based products use FreeRTOS as their operating system and  LWIP is 
their prime choice for  network stack.


?However there is no standard port available in LWIP contrib

Please incorporate this port patch.



Thanks & Best Regards,
Nirav
FreeRTOS port

---
 .../{old/rtxc => freertos/port}/include/arch/cc.h  |  72 ++--
 .../rtxc => freertos/port}/include/arch/init.h |   0
 .../{old/rtxc => freertos/port}/include/arch/lib.h |   0
 .../rtxc => freertos/port}/include/arch/sys_arch.h |  19 +-
 .../include/arch => freertos/port/include}/perf.h  |   0
 ports/freertos/port/sys_arch.c | 480 +
 6 files changed, 540 insertions(+), 31 deletions(-)
 copy ports/{old/rtxc => freertos/port}/include/arch/cc.h (64%)
 copy ports/{old/rtxc => freertos/port}/include/arch/init.h (100%)
 copy ports/{old/rtxc => freertos/port}/include/arch/lib.h (100%)
 copy ports/{old/rtxc => freertos/port}/include/arch/sys_arch.h (81%)
 copy ports/{old/rtxc/include/arch => freertos/port/include}/perf.h (100%)
 create mode 100644 ports/freertos/port/sys_arch.c

diff --git a/ports/old/rtxc/include/arch/cc.h b/ports/freertos/port/include/arch/cc.h
similarity index 64%
copy from ports/old/rtxc/include/arch/cc.h
copy to ports/freertos/port/include/arch/cc.h
index ac55609..05b4e62 100644
--- a/ports/old/rtxc/include/arch/cc.h
+++ b/ports/freertos/port/include/arch/cc.h
@@ -1,8 +1,8 @@
 /*
  * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
- * All rights reserved. 
- * 
- * Redistribution and use in source and binary forms, with or without modification, 
+ * All rights reserved.
+ *
+ * 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,
@@ -11,27 +11,37 @@
  *this list of conditions and the following disclaimer in the documentation
  *and/or other materials provided with the distribution.
  * 3. The name of the author may not be used to endorse or promote products
- *derived from this software without specific prior written permission. 
+ *derived from this software without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
  *
  * This file is part of the lwIP TCP/IP stack.
- * 
+ *
  * Author: Adam Dunkels 
  *
  */
 #ifndef __CC_H__
 #define __CC_H__
 
+#include 
+#include 
+
+#define U16_F "hu"
+#define X16_F "hX"
+#define U32_F "u"
+#define X32_F "X"
+#define S16_F "hd"
+#define S32_F "d"
+
 typedef unsigned   charu8_t;
 typedef signed chars8_t;
 typedef unsigned   short   u16_t;
@@ -39,16 +49,28 @@ typedef signed short   s16_t;
 typedef unsigned   longu32_t;
 typedef signed longs32_t;
 
-#define U16_F "hu"
-#define S16_F "hd"
-#define X16_F "hx"
-#define U32_F "lu"
-#define S32_F "ld"
-#define X32_F "lx"
-
-#define PACK_STRUCT_BEGIN
-#define PACK_STRUCT_STRUCT
-#define PACK_STRUCT_END
-#define PACK_STRUCT_FIELD(x) x
+/* typedef u32_t mem_ptr_t; */
+typedef int sys_prot_t;
+
+#define LWIP_TIMEVAL_PRIVATE 0
+
+/* Define platform endianness */
+#ifndef BYTE_ORDER
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif /* BYTE_ORDER */
+
+/* Compiler hints for packing structures */
+#define PACK_STRUCT_STRUCT __attribute__((packed))
+
+
+/* Plaform specific diagnostic output */
+#define LWIP_PLATFORM_DIAG(x)   do {printf x;} while(0)
+
+#define 

Re: [lwip-users] FreeRTOs port

2016-12-19 Thread Dirk Ziegelmeier
http://lwip.100.n7.nabble.com/lwIP-ports-for-RTEMS-POSIX-based-RTOS-and-FreeRTOS-TMS570-a-LPC17-40xx-drivers-td27134.html


Ciao
Dirk

On Mon, Dec 19, 2016 at 12:16 PM, Nirav Desai  wrote:

> Hello All,
>
> Please find attached a patch which has FreeRTOS port for LWIP.
>
> Many IoT based products use FreeRTOS as their operating system and  LWIP
> is their prime choice for  network stack.
>
>
> ​However there is no standard port available in LWIP contrib
>
> Please incorporate this port patch.
>
>
>
> Thanks & Best Regards,
> Nirav
>
> ___
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users