Re: [lwip-users] Which mbedTLS branch LWIP is supporting—only LTS or development too?

2024-04-09 Thread Dirk Ziegelmeier
As far as I know Simon, he wrote this answer on his mobile phone with
autocorrection turned on :-) :-)

-> [...] we'd happily accept _patches_ to build against newer versions [...]

On Tue, Apr 9, 2024 at 8:17 AM Simon Goldschmidt via lwip-users <
lwip-users@nongnu.org> wrote:

>
>
> Am 8. April 2024 18:46:50 MESZ schrieb Javier Tia :
> >Hi,
> >
> >I was trying to build LWIP with mbedTLS (development branch), but got
> some build errors; not with the mbedTLS LTS branch. I like to confirm if
> LWIP is only supporting the mbedTLS TLS version and not the development
> branch.
> >
>
> As stated in the code, currently only LTS is supported. However, we'd
> happily accept PayPal ches to build against newer versions!
>
> Regards,
> Simon
>
> ___
> 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] SNMPv3 ready for production?

2022-01-09 Thread Dirk Ziegelmeier
SNMPv3 is working fine, you can use it in products

On Tue, Jan 4, 2022 at 4:20 PM Jan Dospěl via lwip-users <
lwip-users@nongnu.org> wrote:

> Hi all,
>
>
>
> I have ported SNMPv1+v2c from IwIP to embedded stack at WiFi SoC CC3220.
> Its works like a charm. But now I considering add support for SNMPv3.
>
>
>
> I found at file snmp_opts.h note that SNMPv3 is experimental and under
> development. It is recommended to use SNMPv3 at production code or not?
>
>
>
> I know that I will need to implement own functions like a snmpv3_auth(),
> snmpv3_crypt(), etc. I will use hardware acceleration inside CC3220 instead
> mbedtls code.
>
>
>
> Thanks,
>
>
>
> Jan
> ___
> 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] Sample code for the mainloop NO_SYS case is broken

2020-07-08 Thread Dirk Ziegelmeier
The code in NO_SYS docs is pseudo-code, you need to implement pbuf queues
by yourself. Usually an OS already supports some kind of queue.

So packet QUEUES are not supported, pbufs only support CHAINS (=one single
ethernet packet splitted into multiple pbufs).
https://www.nongnu.org/lwip/2_1_x/group__pbuf.html

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

Re: [lwip-users] Core locked checking when using the SNMP netconn implementation

2020-03-12 Thread Dirk Ziegelmeier
Hm, you again found a bug. In this case I don't even have quick fix... We
(the company I work for) never used traps so they are basically untested.

Sorry
Dirk


Harrold Spier  schrieb am Do., 12. März 2020,
14:38:

>
> I tried, but unfortunately the last two options both did not work :-(
>
> I see function snmp_coldstart_trap() at the end is calling
> netconn_sendto() to send the packet.
> So I wonder whether it allowed anyway to call the netconn_sendto()
> functions in the tcpip thread?
> The function will probably try to do the core lock itself.
> This would explain it does not work.
>
> Regards,
> Harrold
>
>
> On Thu, Mar 12, 2020 at 2:07 PM Dirk Ziegelmeier 
> wrote:
>
>> The last two options will both work. Read the lwip threading hints in the
>> docs!
>>
>> Harrold Spier  schrieb am Do., 12. März 2020,
>> 13:42:
>>
>>> Hi Dirk,
>>>
>>> Yes, this fixes the reported problem. But there is probably more.
>>> Executing snmpwalk using a wrong community may generate an authentication
>>> trap:
>>>
>>> snmpwalk -v1 -c wrongcommunity 192.168.28.2 1.3
>>>
>>>
>>> [image: image.png]
>>>
>>> This will also generate the core lock assert,
>>> because snmp_send_trap_or_notification_or_inform_generic() checks for it.
>>>
>>> So I'm a little bit confused :-|
>>>
>>> Assume I want to generate a coldstart trap at the start of my
>>> application, what would be the correct way to do so, using the netconn
>>> implementation?
>>>
>>>- Call snmp_coldstart_trap() directly from any thread you like.
>>>- Call snmp_coldstart_trap() only via the tcpip_callback() function.
>>>- Call snmp_coldstart_trap() after calling LOCK_TCPIP_CORE() and before
>>>UNLOCK_TCPIP_CORE().
>>>
>>> Best regards,
>>> Harrold
>>>
>>>
>>> On Thu, Mar 12, 2020 at 11:48 AM Dirk Ziegelmeier 
>>> wrote:
>>>
>>>> you found a bug :-)
>>>>
>>>> Try this, and please create a bug entry:
>>>>
>>>> static s16_t
>>>> system_get_value(const struct snmp_scalar_array_node_def *node, void
>>>> *value)
>>>> {
>>>>   const u8_t  *var = NULL;
>>>>   const s16_t *var_len;
>>>>   u16_t result;
>>>>
>>>>   switch (node->oid) {
>>>> case 1: /* sysDescr */
>>>>   var = sysdescr;
>>>>   var_len = (const s16_t *)sysdescr_len;
>>>>   break;
>>>> case 2: { /* sysObjectID */
>>>> #if SNMP_USE_NETCONN && LWIP_TCPIP_CORE_LOCKING
>>>>   LOCK_TCPIP_CORE();
>>>> #endif
>>>>   const struct snmp_obj_id *dev_enterprise_oid =
>>>> snmp_get_device_enterprise_oid();
>>>> #if SNMP_USE_NETCONN && LWIP_TCPIP_CORE_LOCKING
>>>>   UNLOCK_TCPIP_CORE();
>>>> #endif
>>>>   MEMCPY(value, dev_enterprise_oid->id, dev_enterprise_oid->len *
>>>> sizeof(u32_t));
>>>>   return dev_enterprise_oid->len * sizeof(u32_t);
>>>> }
>>>> case 3: /* sysUpTime */
>>>>   MIB2_COPY_SYSUPTIME_TO((u32_t *)value);
>>>>   return sizeof(u32_t);
>>>> case 4: /* sysContact */
>>>>   var = syscontact;
>>>>   var_len = (const s16_t *)syscontact_len;
>>>>   break;
>>>> case 5: /* sysName */
>>>>   var = sysname;
>>>>   var_len = (const s16_t *)sysname_len;
>>>>
>>>> Ciao
>>>> Dirk
>>>>
>>>> --
>>>> Dirk Ziegelmeier * d...@ziegelmeier.net * http://www.ziegelmeier.net
>>>>
>>>>
>>>> On Thu, Mar 12, 2020 at 11:34 AM Harrold Spier 
>>>> wrote:
>>>>
>>>>> Hi Dirk,
>>>>>
>>>>> Thanks for your quick response.
>>>>>
>>>>> Function snmp_set_device_enterprise_oid() is called by my
>>>>> application, but snmp_get_device_enterprise_oid() for example is
>>>>> called (indirectly) by snmp_receive(), which runs in the snmp_netconn
>>>>> thread.
>>>>>
>>>>> [image: image.png]
>>>>>
>>>>> Best regards,
>>>>> Harrold
>>>>>
>>>>>
>>>>> On Thu, Mar 12, 2020 at 11:16 AM Dirk Ziegelmeier <
>>>>

Re: [lwip-users] Core locked checking when using the SNMP netconn implementation

2020-03-12 Thread Dirk Ziegelmeier
The last two options will both work. Read the lwip threading hints in the
docs!

Harrold Spier  schrieb am Do., 12. März 2020,
13:42:

> Hi Dirk,
>
> Yes, this fixes the reported problem. But there is probably more.
> Executing snmpwalk using a wrong community may generate an authentication
> trap:
>
> snmpwalk -v1 -c wrongcommunity 192.168.28.2 1.3
>
>
> [image: image.png]
>
> This will also generate the core lock assert,
> because snmp_send_trap_or_notification_or_inform_generic() checks for it.
>
> So I'm a little bit confused :-|
>
> Assume I want to generate a coldstart trap at the start of my application,
> what would be the correct way to do so, using the netconn implementation?
>
>- Call snmp_coldstart_trap() directly from any thread you like.
>- Call snmp_coldstart_trap() only via the tcpip_callback() function.
>- Call snmp_coldstart_trap() after calling LOCK_TCPIP_CORE() and before
>UNLOCK_TCPIP_CORE().
>
> Best regards,
> Harrold
>
>
> On Thu, Mar 12, 2020 at 11:48 AM Dirk Ziegelmeier 
> wrote:
>
>> you found a bug :-)
>>
>> Try this, and please create a bug entry:
>>
>> static s16_t
>> system_get_value(const struct snmp_scalar_array_node_def *node, void
>> *value)
>> {
>>   const u8_t  *var = NULL;
>>   const s16_t *var_len;
>>   u16_t result;
>>
>>   switch (node->oid) {
>> case 1: /* sysDescr */
>>   var = sysdescr;
>>   var_len = (const s16_t *)sysdescr_len;
>>   break;
>> case 2: { /* sysObjectID */
>> #if SNMP_USE_NETCONN && LWIP_TCPIP_CORE_LOCKING
>>   LOCK_TCPIP_CORE();
>> #endif
>>   const struct snmp_obj_id *dev_enterprise_oid =
>> snmp_get_device_enterprise_oid();
>> #if SNMP_USE_NETCONN && LWIP_TCPIP_CORE_LOCKING
>>   UNLOCK_TCPIP_CORE();
>> #endif
>>   MEMCPY(value, dev_enterprise_oid->id, dev_enterprise_oid->len *
>> sizeof(u32_t));
>>   return dev_enterprise_oid->len * sizeof(u32_t);
>> }
>> case 3: /* sysUpTime */
>>   MIB2_COPY_SYSUPTIME_TO((u32_t *)value);
>>   return sizeof(u32_t);
>> case 4: /* sysContact */
>>   var = syscontact;
>>   var_len = (const s16_t *)syscontact_len;
>>   break;
>> case 5: /* sysName */
>>   var = sysname;
>>   var_len = (const s16_t *)sysname_len;
>>
>> Ciao
>> Dirk
>>
>> --
>> Dirk Ziegelmeier * d...@ziegelmeier.net * http://www.ziegelmeier.net
>>
>>
>> On Thu, Mar 12, 2020 at 11:34 AM Harrold Spier 
>> wrote:
>>
>>> Hi Dirk,
>>>
>>> Thanks for your quick response.
>>>
>>> Function snmp_set_device_enterprise_oid() is called by my application,
>>> but snmp_get_device_enterprise_oid() for example is called (indirectly)
>>> by snmp_receive(), which runs in the snmp_netconn thread.
>>>
>>> [image: image.png]
>>>
>>> Best regards,
>>> Harrold
>>>
>>>
>>> On Thu, Mar 12, 2020 at 11:16 AM Dirk Ziegelmeier 
>>> wrote:
>>>
>>>> The netconn thread receives SNMP packets and processes them in the SNMP
>>>> stack, nothing else. It never calls snmp_set_device_enterprise_oid(). Put a
>>>> breakpoint in calls snmp_set_device_enterprise_oid() and check the call
>>>> stack. I guess it's your application that makes this call from the wrong
>>>> thread.
>>>>
>>>> Ciao
>>>> Dirk
>>>>
>>>>
>>>> On Thu, Mar 12, 2020 at 10:57 AM Harrold Spier 
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> After enabling core locked check (LWIP_ASSERT_CORE_LOCKED
>>>>> and LWIP_MARK_TCPIP_THREAD), I got a lot of asserts in SNMP functions.
>>>>>
>>>>> I use the SNMP netconn implementation (SNMP_USE_NETCONN = 1), so I
>>>>> assume all SNMP functions should be called by the snmp_netconn thread, not
>>>>> by the tcpip_thread.
>>>>> So why does a function like snmp_set_device_enterprise_oid() does a
>>>>> core check (LWIP_ASSERT_CORE_LOCKED())?
>>>>> I assume this would only be valid for the snmp raw implementation.
>>>>>
>>>>> Or do I miss something?
>>>>>
>>>>> Best regards,
>>>>> Harrold
>>>>> ___
>>>>> 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
>>>
>>> ___
>>> 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
>
> ___
> 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] Core locked checking when using the SNMP netconn implementation

2020-03-12 Thread Dirk Ziegelmeier
you found a bug :-)

Try this, and please create a bug entry:

static s16_t
system_get_value(const struct snmp_scalar_array_node_def *node, void *value)
{
  const u8_t  *var = NULL;
  const s16_t *var_len;
  u16_t result;

  switch (node->oid) {
case 1: /* sysDescr */
  var = sysdescr;
  var_len = (const s16_t *)sysdescr_len;
  break;
case 2: { /* sysObjectID */
#if SNMP_USE_NETCONN && LWIP_TCPIP_CORE_LOCKING
  LOCK_TCPIP_CORE();
#endif
  const struct snmp_obj_id *dev_enterprise_oid =
snmp_get_device_enterprise_oid();
#if SNMP_USE_NETCONN && LWIP_TCPIP_CORE_LOCKING
  UNLOCK_TCPIP_CORE();
#endif
  MEMCPY(value, dev_enterprise_oid->id, dev_enterprise_oid->len *
sizeof(u32_t));
  return dev_enterprise_oid->len * sizeof(u32_t);
}
case 3: /* sysUpTime */
  MIB2_COPY_SYSUPTIME_TO((u32_t *)value);
  return sizeof(u32_t);
case 4: /* sysContact */
  var = syscontact;
  var_len = (const s16_t *)syscontact_len;
  break;
case 5: /* sysName */
  var = sysname;
  var_len = (const s16_t *)sysname_len;

Ciao
Dirk

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


On Thu, Mar 12, 2020 at 11:34 AM Harrold Spier 
wrote:

> Hi Dirk,
>
> Thanks for your quick response.
>
> Function snmp_set_device_enterprise_oid() is called by my application,
> but snmp_get_device_enterprise_oid() for example is called (indirectly)
> by snmp_receive(), which runs in the snmp_netconn thread.
>
> [image: image.png]
>
> Best regards,
> Harrold
>
>
> On Thu, Mar 12, 2020 at 11:16 AM Dirk Ziegelmeier 
> wrote:
>
>> The netconn thread receives SNMP packets and processes them in the SNMP
>> stack, nothing else. It never calls snmp_set_device_enterprise_oid(). Put a
>> breakpoint in calls snmp_set_device_enterprise_oid() and check the call
>> stack. I guess it's your application that makes this call from the wrong
>> thread.
>>
>> Ciao
>> Dirk
>>
>>
>> On Thu, Mar 12, 2020 at 10:57 AM Harrold Spier 
>> wrote:
>>
>>> Hi,
>>>
>>> After enabling core locked check (LWIP_ASSERT_CORE_LOCKED
>>> and LWIP_MARK_TCPIP_THREAD), I got a lot of asserts in SNMP functions.
>>>
>>> I use the SNMP netconn implementation (SNMP_USE_NETCONN = 1), so I
>>> assume all SNMP functions should be called by the snmp_netconn thread, not
>>> by the tcpip_thread.
>>> So why does a function like snmp_set_device_enterprise_oid() does a core
>>> check (LWIP_ASSERT_CORE_LOCKED())?
>>> I assume this would only be valid for the snmp raw implementation.
>>>
>>> Or do I miss something?
>>>
>>> Best regards,
>>> Harrold
>>> ___
>>> 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
>
> ___
> 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] Core locked checking when using the SNMP netconn implementation

2020-03-12 Thread Dirk Ziegelmeier
The netconn thread receives SNMP packets and processes them in the SNMP
stack, nothing else. It never calls snmp_set_device_enterprise_oid(). Put a
breakpoint in calls snmp_set_device_enterprise_oid() and check the call
stack. I guess it's your application that makes this call from the wrong
thread.

Ciao
Dirk


On Thu, Mar 12, 2020 at 10:57 AM Harrold Spier 
wrote:

> Hi,
>
> After enabling core locked check (LWIP_ASSERT_CORE_LOCKED
> and LWIP_MARK_TCPIP_THREAD), I got a lot of asserts in SNMP functions.
>
> I use the SNMP netconn implementation (SNMP_USE_NETCONN = 1), so I assume
> all SNMP functions should be called by the snmp_netconn thread, not by
> the tcpip_thread.
> So why does a function like snmp_set_device_enterprise_oid() does a core
> check (LWIP_ASSERT_CORE_LOCKED())?
> I assume this would only be valid for the snmp raw implementation.
>
> Or do I miss something?
>
> Best regards,
> Harrold
> ___
> 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] autoip_remove_struct()

2019-11-20 Thread Dirk Ziegelmeier
no

Ciao
Dirk


On Wed, Nov 20, 2019 at 9:41 AM Amena El Homsi 
wrote:

> Thanks.. Is there a new lwip version that fixes this bug?
>
> On Wed, Nov 20, 2019 at 10:33 AM Dirk Ziegelmeier 
> wrote:
>
>> thats a bug, a correct function would be
>>
>> /**
>>  * @ingroup autoip
>>  * Remove a struct autoip previously set to the netif using
>> autoip_set_struct()
>>  *
>>  * @param netif the netif for which to set the struct autoip
>>  */
>> void
>> autoip_remove_struct(struct netif *netif)
>> {
>>   LWIP_ASSERT_CORE_LOCKED();
>>   LWIP_ASSERT("netif != NULL", netif != NULL);
>>   LWIP_ASSERT("netif has no struct autoip set",
>>   netif_autoip_data(netif) != NULL);
>>
>>   netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP, NULL);
>> }
>>
>>
>> Ciao
>> Dirk
>>
>>
>> On Wed, Nov 20, 2019 at 9:26 AM Amena El Homsi 
>> wrote:
>>
>>> Hello,
>>>
>>> I set autoip struct using autoip_set_struct(). However, when I call
>>> autoip_remove_struct()  I got a compilation error:
>>> error: no member named 'autoip' in 'struct netif'
>>>
>>> Why dhcp_remove_struct() is expanded to: netif_set_client_data(netif,
>>> LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, NULL)
>>> and autoip_remove_struct is expanded to: do { (netif)->autoip = NULL; }
>>> while (0)
>>> ?
>>>
>>> --
>>>
>>> Amena El-Homsi
>>> Computer & Communication Engineer
>>> Dipl. Eng,  M.S.
>>> ___
>>> 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
>
>
>
> --
>
> Amena El-Homsi
> Computer & Communication Engineer
> Dipl. Eng,  M.S.
> ___
> 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] autoip_remove_struct()

2019-11-20 Thread Dirk Ziegelmeier
thats a bug, a correct function would be

/**
 * @ingroup autoip
 * Remove a struct autoip previously set to the netif using
autoip_set_struct()
 *
 * @param netif the netif for which to set the struct autoip
 */
void
autoip_remove_struct(struct netif *netif)
{
  LWIP_ASSERT_CORE_LOCKED();
  LWIP_ASSERT("netif != NULL", netif != NULL);
  LWIP_ASSERT("netif has no struct autoip set",
  netif_autoip_data(netif) != NULL);

  netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP, NULL);
}


Ciao
Dirk


On Wed, Nov 20, 2019 at 9:26 AM Amena El Homsi 
wrote:

> Hello,
>
> I set autoip struct using autoip_set_struct(). However, when I call
> autoip_remove_struct()  I got a compilation error:
> error: no member named 'autoip' in 'struct netif'
>
> Why dhcp_remove_struct() is expanded to: netif_set_client_data(netif,
> LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, NULL)
> and autoip_remove_struct is expanded to: do { (netif)->autoip = NULL; }
> while (0)
> ?
>
> --
>
> Amena El-Homsi
> Computer & Communication Engineer
> Dipl. Eng,  M.S.
> ___
> 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] Bug in invalidate_cpu_cache() usage

2019-11-02 Thread Dirk Ziegelmeier
It's in the zero-copy example.

Of course your DMA buffers need to be cacheline-aligned, that's why the
example uses custom pbufs, there should also not be any data/variables
between the DMA buffers. And your invalidate() function needs to match
addresses to cache lines.  But all this is out of scope of lwIP, it's a
"private secret" of the ethernet driver.

Dirk


On Sat, Nov 2, 2019 at 9:02 AM goldsimon  wrote:

>
>
> Am 2. November 2019 00:34:41 MEZ schrieb Toshiyasu Morita <
> tmor...@autox.ai>:
> >I was looking through the lwip and I found some obvious problems in the
> >way
> >invalidate_cpu_cache() is used.
>
> That function does not exist in lwIP.  You're probably using some vendor
> version?
>
> Regards,
> Simon
>
> ___
> 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] SNMP for lwip 1.4.1

2019-10-24 Thread Dirk Ziegelmeier
Not really, but there are examples in the contrib directory

Ciao
Dirk


On Thu, Oct 24, 2019 at 10:03 PM Trampas Stern  wrote:

> I did get the lwip 2.1.2 version compiled and ported with httpd running.
> Is there a quick start guide for SNMP?
>
> I am new to SNMP, and have started reading up so if there is a good primer
> for background I should read first, by all means let me know.
>
> Thanks
> Trampas
>
> On Thu, Oct 24, 2019 at 3:06 PM goldsi...@gmx.de  wrote:
>
>> Am 24.10.2019 um 20:35 schrieb Trampas Stern:
>> > I am with you on the old software! I would rather find new bugs than old
>> > bugs that have been fixed. I start porting the latest lwip version.
>>
>> OK, please report back anything that's missing in the UPGRADING document.
>>
>> Thanks,
>> Simon
>>
>> ___
>> 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
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Status of snmp v3

2019-09-26 Thread Dirk Ziegelmeier
sorry, I don't have an idea at the moment. I only tested with SnmpB and
that worked well.

Ciao
Dirk


On Thu, Sep 26, 2019 at 1:10 PM Mário Luzeiro  wrote:

> Hi Dirk,
>
> > it is technically complete
> thanks for all your work!
> I missed a bit some debug output as there are on other modules in LWIP but
> I am doing some manual debug.
>
>
> I'm trying to run the example code with v3 and use snmpwalk (linux tool)
> to test it.
> I changed the engine boot and time to be always 0 for test proposes.
> I need to change the engineID to 12 octets(bytes) so snmpwalk (and
> wireshark) will not complain.
>
> The far I can get is running this command and get this result:
> $ snmpwalk -v3 -l authPriv -u lwip -a SHA -A "maplesyrup" -x DES -X
> "maplesyrup" 192.168.1.3 -e  -Z 0,0
> iso.3.6.1.2.1.1.1.0 = STRING: "lwIP example"
> iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.26381
> iso.3.6.1.2.1.1.3.0 = Timeticks: (100158) 0:16:41.58
> iso.3.6.1.2.1.1.4.0 = STRING: "root"
> iso.3.6.1.2.1.1.5.0 = STRING: "FQDN-unk"
> iso.3.6.1.2.1.1.6.0 = STRING: "lwIP development PC"
> iso.3.6.1.2.1.1.7.0 = INTEGER: 72
> iso.3.6.1.2.1.2.1.0 = INTEGER: 1
> iso.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1
> snmpwalk: Authentication failure (incorrect password, community or key)
>
> Why is it getting some data and then in the end reports some
> authentication failure?
> As I don't know about SNMP protocol, I am not sure if thats ok or
> something is wrong..
> Hope you can clarify me.
>
> Mario Luzeiro
>
> 
> From: lwip-users  on
> behalf of Dirk Ziegelmeier 
> Sent: 24 September 2019 19:18
> To: Mailing list for lwIP users
> Subject: Re: [lwip-users] Status of snmp v3
>
> it is technically complete, it only needs proper implementation of the
> functions in
>
> http://git.savannah.nongnu.org/cgit/lwip.git/tree/contrib/examples/snmp/snmp_v3/snmpv3_dummy.c
>
> which is the glueing code to your application.
>
> And of course it needs mbedtls in your project, or a reimplentation of
>
> http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/apps/snmp/snmpv3_mbedtls.c
>
> Ciao
> Dirk
>
>
> On Tue, Sep 24, 2019 at 7:21 PM Mário Luzeiro  mrluze...@ua.pt>> wrote:
> Hello all,
> I'm testing SNMP sample from LWIP.
>
> What is the status of SNMP V3 implementation in LWIP?
> It only misses the user callback implementation or is missing something in
> the core?
>
> I tried to build with V3 enabled and I got errors on the use of
> mbedtls_sha1* and mbedtls_md5* functions.
> Am I missing some define?
>
> Mario
> ___
> lwip-users mailing list
> lwip-users@nongnu.org<mailto: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
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Status of snmp v3

2019-09-24 Thread Dirk Ziegelmeier
it is technically complete, it only needs proper implementation of the
functions in
http://git.savannah.nongnu.org/cgit/lwip.git/tree/contrib/examples/snmp/snmp_v3/snmpv3_dummy.c

which is the glueing code to your application.

And of course it needs mbedtls in your project, or a reimplentation of
http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/apps/snmp/snmpv3_mbedtls.c

Ciao
Dirk


On Tue, Sep 24, 2019 at 7:21 PM Mário Luzeiro  wrote:

> Hello all,
> I'm testing SNMP sample from LWIP.
>
> What is the status of SNMP V3 implementation in LWIP?
> It only misses the user callback implementation or is missing something in
> the core?
>
> I tried to build with V3 enabled and I got errors on the use of
> mbedtls_sha1* and mbedtls_md5* functions.
> Am I missing some define?
>
> Mario
> ___
> 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] Raw Ethernet II frames for PTP

2019-07-25 Thread Dirk Ziegelmeier
What do you need an IP stack for when you want to process raw ethernet
frames???

Dirk

On Thu, Jul 25, 2019 at 10:25 PM Nathan Immerman via lwip-users <
lwip-users@nongnu.org> wrote:

> Hi all,
>
> I am implementing a software Precision Time Protocol (PTP) implementation
> which requires reading Raw Ethernet II frames, no TCP/IP/UDP. An example
> packet is copied below. Is this possible using lwIP?
>
> I see the raw_new api accepts a proto parameter but there doesn't seem to
> be a protocal define for raw frames.
>
> Protocols defined in ip.h
> #define IP_PROTO_ICMP1
> #define IP_PROTO_IGMP2
> #define IP_PROTO_UDP 17
> #define IP_PROTO_UDPLITE 136
> #define IP_PROTO_TCP 6
>
> Thank you.
>
> Example PTP Raw Ethernet II frame copied from Wireshark
>
> Frame 28: 60 bytes on wire (480 bits), 60 bytes captured (480 bits)
> Encapsulation type: Ethernet (1)
> Arrival Time: Jul 24, 2019 16:29:02.184864000 PDT
> [Time shift for this packet: 0.0 seconds]
> Epoch Time: 1564010942.184864000 seconds
> [Time delta from previous captured frame: 0.008057000 seconds]
> [Time delta from previous displayed frame: 0.008057000 seconds]
> [Time since reference or first frame: 0.264827000 seconds]
> Frame Number: 28
> Frame Length: 60 bytes (480 bits)
> Capture Length: 60 bytes (480 bits)
> [Frame is marked: False]
> [Frame is ignored: False]
> [Protocols in frame: eth:ethertype:ptp]
> [Coloring Rule Name: Broadcast]
> [Coloring Rule String: eth[0] & 1]
> Ethernet II, Src: Trimble_70:09:90 (00:17:47:70:09:90), Dst:
> IeeeI_00:00:00 (01:1b:19:00:00:00)
> Destination: IeeeI_00:00:00 (01:1b:19:00:00:00)
> Address: IeeeI_00:00:00 (01:1b:19:00:00:00)
>  ..0.     = LG bit: Globally unique address
> (factory default)
>  ...1     = IG bit: Group address
> (multicast/broadcast)
> Source: Trimble_70:09:90 (00:17:47:70:09:90)
> Address: Trimble_70:09:90 (00:17:47:70:09:90)
>  ..0.     = LG bit: Globally unique address
> (factory default)
>  ...0     = IG bit: Individual address
> (unicast)
> Type: PTPv2 over Ethernet (IEEE1588) (0x88f7)
> Padding: 
> Precision Time Protocol (IEEE1588)
>   = transportSpecific: 0x0
>   = messageId: Sync Message (0x0)
>  0010 = versionPTP: 2
> messageLength: 44
> subdomainNumber: 24
> flags: 0x
> 0...    = PTP_SECURITY: False
> .0..    = PTP profile Specific 2: False
> ..0.    = PTP profile Specific 1: False
>  .0..   = PTP_UNICAST: False
>  ..0.   = PTP_TWO_STEP: False
>  ...0   = PTP_ALTERNATE_MASTER: False
>   ..0.  = FREQUENCY_TRACEABLE: False
>   ...0  = TIME_TRACEABLE: False
>    0... = PTP_TIMESCALE: False
>    .0.. = PTP_UTC_REASONABLE: False
>    ..0. = PTP_LI_59: False
>    ...0 = PTP_LI_61: False
> correction: 582.15 nanoseconds
> correction: Ns: 582 nanoseconds
> correctionSubNs: 1.52587890625e-05 nanoseconds
> ClockIdentity: 0x001747fffe700990
> SourcePortID: 1
> sequenceId: 9796
> control: Sync Message (0)
> logMessagePeriod: -4
> originTimestamp (seconds): 1564010979
> originTimestamp (nanoseconds): 187716775
> ___
> 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] Why doesn't udp_recv callback contain the received netif?

2019-06-25 Thread Dirk Ziegelmeier
Correct!

See also: https://www.nongnu.org/lwip/2_1_x/multithreading.html

Ciao
Dirk


On Tue, Jun 25, 2019 at 11:12 AM wayne.ur...@tridentrfid.com <
wayne.ur...@tridentrfid.com> wrote:

> Wow, cool.
>
> Question: how is this thread safe - because the callback happens inside the
> TCP thread and so only one packet is processed at a time?
>
> Thanks
> - Wayne
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> ___
> 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] Why doesn't udp_recv callback contain the received netif?

2019-06-25 Thread Dirk Ziegelmeier
Simply call ip_current_netif() to get it

Ciao
Dirk


On Tue, Jun 25, 2019 at 5:11 AM Wayne Uroda 
wrote:

> Hi,
>
> Please forgive me if this is a stupid question.
>
> I am writing a DHCP server and using udp_recv functionality to handle
> incoming broadcast messages on a udp pcb.
> I have enabled the BROADCAST flag on the PCB and I can receive the
> incoming packets just fine. The udp pcb is bound to ip_addr_any.
>
> When it comes time to respond to the DHCP discover message, I must use
> udp_sendto_if function. Without specifying the interface, any send fails
> with a routing error because all addresses associated with this first
> message are either 0.0.0.0 or 255.255.255.255 (the only genuine address
> available is the source hardware address, which is useless for determining
> the associated netif).
>
> Here is where I am confused. In order to call udp_sendto_if, I need to
> know the netif. If I look at the udp_input function, the netif is available
> there and could easily be passed as a simple parameter to the recv callback
> function.
>
> Any time I get the urge to modify lwip itself my first thought is, I must
> be missing something simple, or doing something wrong. I assume there is
> some foundational piece of information I am missing?
> If not, should we add the netif as a parameter to the udp recv callback?
>
> Thanks
> - Wayne
> ___
> 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] Does lwip have snmp socket implementation?

2019-05-12 Thread Dirk Ziegelmeier
No, but the netconn implementation is basically a socket implementation.
The Socket implementation of lwIP is a wrapper around the netconn API. You
can (and should) change the thread priority of the SNMP thread to be lower
then the priority of the lwIP main thread.

Dirk


On Fri, May 10, 2019 at 8:45 PM yanhc519  wrote:

> Hi all.
>
> In src/apps/snmp directory, I found snmp_raw.c and snmp_netconn.c.
> However, I cannot find snmp_socket.c which should be a socket
> implementation.
>
> Since my rest applications are all based on socket, so I just want to find
> an snmp socket implementation to use.
>
> Does lwip have snmp socket implementation?
>
> Any suggestion will be appreciated.
>
> Best regards,
>
> yan
> ___
> 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] How receive UDP broadcast with LwIP ?

2019-02-07 Thread Dirk Ziegelmeier
Can you at least check/debug to be sure your MAC delivers the desired
packet to lwIP? e.g. by dumping the first few bytes of all received packets
and looking for your desired broadcast?

If that is not the case, consult your MAC manual about broadcast reception
/ MAC filters.

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

Re: [lwip-users] How receive UDP broadcast with LwIP ?

2019-02-07 Thread Dirk Ziegelmeier
Did you configure your MAC to receive multicasts/boradcasts? lwIP cannot do
this!

Ciao
Dirk


On Thu, Feb 7, 2019 at 3:39 PM Pekub  wrote:

> Hello,
>
> I have this problem. I need to receive UDP Broadcast, but The "callback"
> function is never called.
>
> I use LwIP 2.0.3.
>
> /*- Default Value for IP_SOF_BROADCAST: 0 ---*/
> #define IP_SOF_BROADCAST 1
> /*- Default Value for IP_SOF_BROADCAST_RECV: 0 ---*/
> #define IP_SOF_BROADCAST_RECV 1
>
> void udp_server_init(void)
> {
>  struct udp_pcb *upcb;
>  err_t err;
>
>  upcb = udp_new();
>  ip_set_option(upcb, SOF_BROADCAST);
>
>  if (upcb)
>  {
>  err = udp_bind(upcb, IP_ADDR_BROADCAST, 8000);
>
>  if(err == ERR_OK)
>  {
> udp_recv(upcb, udp_receive_callback, NULL);
>  }
>  }
> }
>
> void udp_receive_callback(void *arg, struct udp_pcb *upcb, struct pbuf *p,
> const ip_addr_t *addr, u16_t port)
> {
>HAL_GPIO_TogglePin(GPIOE, GPIO_PIN_2);
>
>pbuf_free(p);// Free the p buffer
>
>//udp_transmit(upcb, addr, udp2_tx_data, udp2_tx_len);
> }
>
> What is wrong ?
>
> Peter
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> ___
> 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] Netconn API for UDP and Raw API for TCP

2019-02-06 Thread Dirk Ziegelmeier
You are violating threading rules in the thread using the RAW API.

See:
https://www.nongnu.org/lwip/2_1_x/pitfalls.html
https://www.nongnu.org/lwip/2_1_x/multithreading.html

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

Re: [lwip-users] Settibg/Getting IPv6 address

2019-01-09 Thread Dirk Ziegelmeier
https://www.nongnu.org/lwip/2_1_x/group__netif__ip6.html

HTH
Dirk


On Wed, Jan 9, 2019 at 2:03 PM saad saeed  wrote:

> Dear All,
>
> I am new to lwIP. I want to know that, how can I get the assigned IPv6
> address and how can I assign the IPv6 address. Are there any examples for
> this.
>
> Regards,
>
> Saad.
>
> ___
> 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] Changed IP address during runtime but TCP PCB stuck time wait state

2018-12-17 Thread Dirk Ziegelmeier
Ich you listen to an ANY IP address, then rebinding the netconn should not
be necessary. Otherwise, check SO_REUSE.

Dirk



On Mon, Dec 17, 2018 at 4:40 AM uaz  wrote:

> Hi All,
>
> I am doing a webserver that allows users to change device ip address during
> runtime (no power reset required).
> I've tried 2 ways of doing so:
> 1. netif_set_addr()
> 2. netif_remove() and then netif_add() a new interface with the new ip
> address
>
> In both methods, I will re-init my http server:
> 1. netconn_close()
> 2. netconn_delete()
> 3. Create a new netconn: netconn_new()
> 4. Bind to http port: netconn_bind()
>
> Unfortunately, netconn_bind() to port 80 will fail because apparently the
> previous pcb bound to port 80 is still there, in time wait state (lwip will
> not allow multiple sockets listening to the same port).
>
> How do I make sure the previous pcb is completely deleted or freed?
>
> Thanks
>
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> ___
> 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] Custom placement of memory pool

2018-11-09 Thread Dirk Ziegelmeier
Yes, in exactly the same way - just figure out the name of the PBUF pool
(see linker map file) and add an external with appropriate GCC attribute to
cc.h

Dirk


On Fri, Nov 9, 2018 at 3:14 PM uaz  wrote:

> Hi Dirk,
>
> Thanks for the heads up. I lost focus because I was drowning in the macros.
>
> Ok, now I understand that I can define my own memory pool at custom
> address.
>
> But how about pbuf buffers? Is it possible to relocate them to different
> address?
>
> Now I get confused with pbuf pool (PBUF_POOL_SIZE) with the memp custom
> pool
> (MEMP_USE_CUSTOM_POOLS).
> Does it mean that:
> - if I set MEMP_USE_CUSTOM_POOLS to 1, I can set PBUF_POOL_SIZE to 0
> because
> memp_malloc() will look for available slot from the custom pool instead of
> pbuf pool?
>
> Regards,
> UAZ
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> ___
> 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] Custom placement of memory pool

2018-11-09 Thread Dirk Ziegelmeier
To relocate a pool, see:

https://www.nongnu.org/lwip/2_1_x/group__mempool.html#ga5b1fb3ce7942432d87cc948b1c5ed6cb

"To relocate a pool, declare it as extern in cc.h. Example for GCC: extern
u8_t __attribute__((section(".onchip_mem")))
memp_memory_my_private_pool_base[];"

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

Re: [lwip-users] Lwip http server example raw api

2018-08-30 Thread Dirk Ziegelmeier
The examples have moved here:
http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git/tree/examples/httpd

Dirk



On Thu, Aug 30, 2018 at 1:45 AM Keith Rubow  wrote:

> Is there no longer an http server example using the raw api for lwip
> 2.x? I only see one in the contrib-1.4.1, but not in any contrib-2.x. Or
> does the old httpserver_raw from contrib-1.4.1 still work with lwip
> 2.0.2? (Not likely, I suspect).
>
> ___
> 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] SNMP v3

2018-08-29 Thread Dirk Ziegelmeier
Yes, it is functional (git head or 2.1 beta). Be aware the user needs to
implement a lot of things for it (user/password management). The MIB
compiler is not affected by the SNMP version.

Dirk



On Wed, Aug 29, 2018 at 12:37 PM Andy Pont  wrote:

> Hello,
>
> I am trying to make sense of the current state of SNMP v3 in lwIP as the
> documentation seems a little confused.  Is SNMP v3 fully functional and
> does the MIB compiler support it?
>
> -Andy.
>
>
>
> ___
> 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] Can't compile unix unit tests using Cmake

2018-08-27 Thread Dirk Ziegelmeier
No, I having problems with that on Kubuntu 18.4, too. I'll disable the
offending compiler flags to avoid problems in 2.1 release.

Dirk


On Sun, Aug 26, 2018 at 9:55 AM Joan Lledó  wrote:

> Hi,
>
> I tried to compile the unix unit tests in debian stable and ubuntu
> 18.04 and in both cases I found that liblwipcore.a and
> liblwipallapps.a are built correctly but trying to link lwip_unittests
> fails with hundreds of "undefined reference" messages like these:
>
> [100%] Linking C executable lwip_unittests
> CMakeFiles/lwip_unittests.dir/home/lwip/lwip/test/unit/lwip_unittests.c.o:
> In fu
> nction `create_suite':
> /home/lwip/lwip/test/unit/lwip_unittests.c:34: undefined reference to
> `__ubsan_h
> andle_type_mismatch'
> /home/lwip/lwip/test/unit/lwip_unittests.c:34: undefined reference to
> `__asan_re
> port_load8'
> /home/lwip/lwip/test/unit/lwip_unittests.c:34: undefined reference to
> `__ubsan_h
> andle_type_mismatch'
> /home/lwip/lwip/test/unit/lwip_unittests.c:34: undefined reference to
> `__asan_re
> port_load8'
> ...
>
> Trying with just "make check" works fine.
> These are the steps I follow:
>
> 1 cd ports/unix/check/
> 2 mkdir build
> 3 cd build
> 4 cmake ..
> 5 make
>
> I'm totally new to Cmake, am I doing something wrong?
>
> ___
> 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] Request for ALTCP example etc.

2018-08-03 Thread Dirk Ziegelmeier
Maybe a look at httpd_inits() may help you for now

lwip\src\apps\http\httpd.c ​

Ciao
Dirk


On Fri, Aug 3, 2018 at 9:37 AM Richard Man  wrote:

> Hi Simon or others, I am attempting to build 2.1.0 RC1 with ALTCP,
> specifically with the mbedTLS 2.12.0. Looks like I need to map the function
> pointers in altcp_tcp.h to the mbedTLS functions, but if there is a working
> example that I can leverage, I would appreciate it. There is some urgency
> in this (but why of course).
>
> Thank you, and thank you for great work with lwIP!
>
> --
> // richard http://imagecraft.com
> Beyond Arduino - When you're ready to get serious...
> JumpStart C Tools for Atmel AVR and Cortex-M, The Better Alternative
> ___
> 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 2.1 cleanup - remove UNIX test apps

2018-06-16 Thread Dirk Ziegelmeier
I agree a simple build system ideally without any dependency is best. But
cmake provides a great advantage: you prefer Makefiles, others prefer
Visual Studio projects, others Eclipse projects, others Ninja as a build
system etc. - cmake provides all of this and the cmake files are more
readable, at least after getting used to yet-another-syntax. The drawback
is you have to install one more dependency...
I still want to provide the Filelists.mk files, these won't go away, so it
will be always easy to maintain a Makefile based system for your own
projects without installing cmake.

Dirk


On Fri, Jun 15, 2018 at 11:57 PM Yigal Hochberg 
wrote:

> Thanks Dirk,
>
> I like and prefer gnu Makefiles ready to go. They work work well in Linux
> and on Windows using Mingw and Cygwin.
> For msvc all you need is to change the CC and CFLAGS and you are good to
> go. msvc 2017 is finally very close to c99 or even later.
> The "older" file organization with Makefiles without the need to
> additional cmake processing.
> For all windows the final link needs win pcap lib (taken from wherever it
> was installed).
>
> I will try your suggestion for cmake (will need to install cmake).
> If it is simple and reliable maybe it is a godo improvement.
>
> Thanks
> Yigal
>
>
>
>
>
>
>
>
> On Fri, Jun 15, 2018 at 3:28 PM, Dirk Ziegelmeier 
> wrote:
>
>> Hi Yigal,
>>
>> I removed it because you can generate easily a Makefile-based build (and
>> many others) using cmake.
>>
>> - cd into example_app dir
>> - mkdir build
>> - cd build
>> - cmake .. -G "MinGW Makefiles"
>> - make
>>
>> ​The msvc_netif_init contains no platform specific code. I just forgot to
>> rename it. Just pushed a fix it a f​ew minutes before.
>>
>>
>> Dirk
>>
>>
>> ___
>> lwip-users mailing list
>> lwip-users@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/lwip-users
>>
>
>
>
> --
> Yigal
> ___
> 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 2.1 cleanup - remove UNIX test apps

2018-06-15 Thread Dirk Ziegelmeier
Hi Yigal,

I removed it because you can generate easily a Makefile-based build (and
many others) using cmake.

- cd into example_app dir
- mkdir build
- cd build
- cmake .. -G "MinGW Makefiles"
- make

​The msvc_netif_init contains no platform specific code. I just forgot to
rename it. Just pushed a fix it a f​ew minutes before.


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

Re: [lwip-users] lwIP 2.1 cleanup - remove UNIX test apps

2018-06-15 Thread Dirk Ziegelmeier
Hi Sergio,

you "*started long ago* using 'minimal' for development and teaching" -
does that mean you still use it today? Do you want me to keep it?

The TAP (not TUN) interface will remain, since the example_app uses it. Do
you need the TUN interface?

If I got you right, lib, simhost, simnode and simrouter can be removed -
you do not care about it.

​I have no objections against keeping this stuff, but most of it is not
really maintained - I try to keep it compileable, but I don't know whether
everything except simhost is actually working. To reduce maintenance and to
improve quality (by only shipping tested stuff)​ I'd like to remove
everything where noone cares about.

Dirk


On Fri, Jun 15, 2018 at 2:53 PM Sergio R. Caprile 
wrote:

> Hi,
> I started long ago using 'minimal' for development and teaching.
> I need a tap interface and the stack compiled to run as NO_SYS=1, as my
> work is on bare metal stuff.
> Yes, I use the lib. I guess there is no _need_ for it and I can just
> compile lwIP and link to it as in a regular embedded project. Since the
> lib was there, I've been using it.
>
> ___
> 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-devel] lwIP 2.1 cleanup - remove UNIX test apps

2018-06-15 Thread Dirk Ziegelmeier
yes.

delif, tunif, pcapif are not used anywhere. tcpdump does not support IPv6.
unixif is used by simnode and simrouter which I personally never started.
-> These are all at least untested by myself. I don't know if anybody else
uses them, at least noone had complaints so far.

Should all these netifs be deleted, too? Does anyone out there use them?

Ciao
Dirk


On Fri, Jun 15, 2018 at 11:39 AM Simon Goldschmidt  wrote:

> Dirk Ziegelmeier wrote:
> > Hello all,
> >
> > in order to clean up for lwIP 2.1, I'd like to remove the UNIX port test
> applications
> >
> > - lib
> > - minimal
> > - unixsim
> >
> > The only remaining test/debug app would be the new "example_app" that
> shares most of the code with the windows port.
> > We would then have only one common app shared between windows and unix
> port to reduce maintenance effort.
>
> Does that mean only 'tapif' is used/compiled/supported under unix now?
> What happens to the other, now unused netifs?
>
>
> Simon
>
> ___
> 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

[lwip-users] lwIP 2.1 cleanup - remove UNIX test apps

2018-06-15 Thread Dirk Ziegelmeier
Hello all,

in order to clean up for lwIP 2.1, I'd like to remove the UNIX port test
applications

- lib
- minimal
- unixsim

The only remaining test/debug app would be the new "example_app" that
shares most of the code with the windows port.
We would then have only one common app shared between windows and unix port
to reduce maintenance effort.

Any objections? Please speak up now :-)

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

Re: [lwip-users] Defining a function call via a macro in lwipopts.h

2018-05-15 Thread Dirk Ziegelmeier
See LWIP_HOOK_FILENAME

​
http://www.nongnu.org/lwip/2_0_x/group__lwip__opts__hooks.html#ga11ac9d637cb6afc0a32e8da7f51d0c0d

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

[lwip-users] Transition to CMake?

2018-04-27 Thread Dirk Ziegelmeier
Hello all,

those who watch the lwIP commits have noticed I started working on a CMake
based build system.

My question is: Is there an interest in the old Makefile-based system? I'm
currently tempted to throw it away :-) I'd just keep the Filelists.mk files
for people with Makefile build systems.

The *far* goal would be to also unify the UNIX and Win32 applications.
CMake will automatically detect the build host and pull in the appropriate
port (Unix/Win32). The netif selection also needs to be per platform, UNIX
uses tapif/tunif and Windows uses pcap.
So the next question is: Who cares about simhost/minimal/lib/check project
in the unix port? Are they important for someone? I'd say we throw them
away and clean up the windows application some more. Currently Simon
maintains the Win32 app and I care about the simhost unix app. They
basically do the same, so this is a waste of time.

Please guys give us some feedback on this!

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

Re: [lwip-users] DOXYGEN usage

2018-04-12 Thread Dirk Ziegelmeier
So, then what is your question? There is even a batch file to generate the
docs in the directory I sent you. Did you try it???


Ciao
Dirk

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

On Thu, Apr 12, 2018 at 2:57 PM, cookies_do <amina.bra...@softhouse.se>
wrote:

> Thank you for your answer. Yes, I have looked at it.
>
> As I said, I am new with Doxygen and lwIP. Thats why I ask this question.
>
> Regards.
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> ___
> 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] DOXYGEN usage

2018-04-12 Thread Dirk Ziegelmeier
??? Did you ever look at the code on lwIPs homepage?

http://git.savannah.gnu.org/cgit/lwip.git/tree/doc/doxygen



Ciao
Dirk

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

On Thu, Apr 12, 2018 at 2:31 PM, cookies_do <amina.bra...@softhouse.se>
wrote:

> Hello!
>
> I am new with Doxygen and lwIP, so I would like to ask if anyone used
> Doxygen with lwIP to generate the documentation? Is there any source code
> available online?
>
> Also, do I have to define __DOXYGEN__ in order to use it? And do I have to
> do any other modifications in lwIP code, so I can use Doxygen?
>
>
> Thanks in advance.
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> ___
> 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] Initialization problem upgrading from 1.4.1 to 2.0.3

2018-04-05 Thread Dirk Ziegelmeier
try to add #include "lwip/ip_addr.h"

and read http://www.nongnu.org/lwip/2_0_x/upgrading.html
especially "Changed netif "up" flag handling to be an administrative flag
[...]" -> don't forget to call netif_set_up()



Ciao
Dirk

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

On Thu, Apr 5, 2018 at 8:29 PM, Keith Rubow <kru...@micro-aide.com> wrote:

> I am trying to use lwip on ARM cortex M4. My development software is
> Atollic Truestudio on Win10. So far I have gotten lwip 1.4.1 to work using
> raw api and a simple multitasking OS.
>
> Now I am trying to change over to lwip 2.0.3, and am having trouble with
> initialization. My initialization code is as follows:
> #include "lwipopts.h"
> #include "lwip/tcpip.h"
> #include "lwip/tcp.h"
> struct netif wiznetif;// network interface struct for wiznet
> ...
> static void initialize_lwip(void) {
> struct ip_addr ipaddr, netmask, gateway;
>
> IP4_ADDR(, setup.ip_address[0], setup.ip_address[1],
> setup.ip_address[2], setup.ip_address[3]);
> IP4_ADDR(, setup.subnet[0], setup.subnet[1], setup.subnet[2],
> setup.subnet[3]);
> IP4_ADDR(, setup.gateway[0], setup.gateway[1],
> setup.gateway[2], setup.gateway[3]);
> tcpip_init(NULL, NULL);
> netif_add(, , , , NULL,
> _init, _input);
> netif_set_up();
> }
>
> This works with lwip 1.4.1, but with 2.0.3 I get an compile error, storage
> size of 'ipaddr' isn't known. Apparently struct ip_addr isn't defined. I
> must be missing an include. Or maybe the ip address is defined differently
> in 2.0.3? I can't seem to find a simple example of initialization code for
> 2.0.3. BTW, I use ipv4 only, no ipv6.
>
> Also, any other raw api or sys_arch changes I need to watch out for in
> 2.0.3?
>
> Keith
>
>
> ___
> 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] Set DNS servers IPs manually

2018-02-13 Thread Dirk Ziegelmeier
DNS_MAX_SERVERS must be greater than LWIP_DHCP_MAX_DNS_SERVERS

and

http://www.nongnu.org/lwip/2_0_x/group__dns.html

HTH
Dirk

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

On Tue, Feb 13, 2018 at 10:49 AM, cookies_do <amina.bra...@softhouse.se>
wrote:

> Hello everyone.
>
> I am using lwIP version 2.0.3 and in this current version IPs for DNS
> servers are provided by DHCP. Can setting the DNS servers IPs be done
> manually (not by DHCP) in this version?
>
> Thanks in advance.
>
> Regards
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> ___
> 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] How to solve netif is not up issue

2018-01-10 Thread Dirk Ziegelmeier
Read http://www.nongnu.org/lwip/2_0_x/upgrading.html

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

Re: [lwip-users] Double VLAN tagging

2018-01-10 Thread Dirk Ziegelmeier
yes, it discards them


Ciao
Dirk

On Wed, Jan 10, 2018 at 10:08 AM, Amena El Homsi <amena.elho...@gmail.com>
wrote:

> So the LwIP discards such frames, right?
>
> Thanks
> Amena
>
> On Wed, Jan 10, 2018 at 10:56 AM, Dirk Ziegelmeier <d...@ziegelmeier.net>
> wrote:
>
>> No, lwIP doesn't support it. But it should be easy to add in
>> src/netif/ethernet.c.
>>
>> Ciao
>> Dirk
>>
>> On Wed, Jan 10, 2018 at 9:41 AM, Amena El Homsi <amena.elho...@gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> In the eth_type enum, I didn't see the ETHTYPE 0x88a8 referring to the
>>> TPID of service-provider outer S-TAG used when the Ethernet frame have
>>> double VLAN tagging.
>>> Does LwIP support Ethernet frames with double VLAN tagging?
>>>
>>> Thanks,
>>> Amena
>>>
>>> --
>>>
>>> Amena El-Homsi
>>> Computer & Communication Engineer
>>> Dipl. Eng,  M.S.
>>>
>>> ___
>>> 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
>>
>
>
>
> --
>
> Amena El-Homsi
> Computer & Communication Engineer
> Dipl. Eng,  M.S.
>
> ___
> 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] Double VLAN tagging

2018-01-10 Thread Dirk Ziegelmeier
No, lwIP doesn't support it. But it should be easy to add in
src/netif/ethernet.c.

Ciao
Dirk

On Wed, Jan 10, 2018 at 9:41 AM, Amena El Homsi 
wrote:

> Hello,
>
> In the eth_type enum, I didn't see the ETHTYPE 0x88a8 referring to the
> TPID of service-provider outer S-TAG used when the Ethernet frame have
> double VLAN tagging.
> Does LwIP support Ethernet frames with double VLAN tagging?
>
> Thanks,
> Amena
>
> --
>
> Amena El-Homsi
> Computer & Communication Engineer
> Dipl. Eng,  M.S.
>
> ___
> 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] mDNS

2017-12-18 Thread Dirk Ziegelmeier
This is not an lwIP issue, but a configuration issue of your ethernet
driver. Contact Xilinx for support on that driver.

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

Re: [lwip-users] mDNS

2017-12-16 Thread Dirk Ziegelmeier
Did you configure your netif to receive broadcasts?

Do you call

mdns_resp_netif_settings_changed()

when your link state / IP changes? This will trigger a broadcast.

http://www.nongnu.org/lwip/2_0_x/group__mdns.html

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

Re: [lwip-users] SNMP MIB CREATE

2017-12-11 Thread Dirk Ziegelmeier
That's simply because the number in the first tree node after the MIB OID
is ignored. The macro practically reads "SNMP_CREATE_TREE_NODE(, private_nodes);" -  but again, only for the FIRST tree node after
a MIB node!

​To avoid confusion, that "don't care number" should be the same as the
last number as in the base MIB.​


Ciao
Dirk

On Sun, Dec 10, 2017 at 11:28 AM, Zahir Lalani  wrote:

> Hi All
>
> Been looking at the examples for MIB setup but one thing in the example
> confused me:
>
> Ref:
> https://github.com/yarrick/lwip-contrib/blob/master/
> examples/snmp/snmp_priva
> te_mib/lwip_prvmib.c
>
>
> Option 1 for the base MIB node is:
> 
> 
> -
> /* example .1.3.6.1.4.1.26381.1 */
> static const struct snmp_tree_node example_node = SNMP_CREATE_TREE_NODE(1,
> example_nodes);
>
> static const u32_t prvmib_base_oid[] = { 1,3,6,1,4,1,26381,1 };
>
> const struct snmp_mib mib_private = SNMP_MIB_CREATE(prvmib_base_oid,
> _node.node);
> 
> 
> -
>
> In this case the base oid ends in 1, and the tree node create uses 1 as the
> oid node. Makes sense.
>
> The code then gives an alternate example which builds up the base from
> higher up the tree. The base node create is now:
>
> 
> 
> -
> /* private .1.3.6.1.4 */
> static const struct snmp_node* const private_nodes[] = {
>   _node.node
> };
> static const struct snmp_tree_node private_root = SNMP_CREATE_TREE_NODE(0,
> private_nodes);
>
> static const u32_t prvmib_base_oid[] = { 1,3,6,1,4 };
> const struct snmp_mib mib_private = SNMP_MIB_CREATE(prvmib_base_oid,
> _root.node);
> 
> 
> -
>
> Here the base node ends in 4, and I would have expected the tree node
> create
> to use 4 as the node id, but it uses 0.
>
> Which one is correct?
>
> Thx
>
>
> Z
>
>
> ___
> 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] Problem running lwip on cortex M7 with D cache enabled

2017-11-30 Thread Dirk Ziegelmeier
> We still have a task open to work on fully supporting zero copy tx/rx.
>

To clarify: 2.0.3 supports zero-copy RX:
http://www.nongnu.org/lwip/2_0_x/group__pbuf.html

Section "Detailed Description"

but NOT TX!

Maybe RX is "good enough" for you.

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

Re: [lwip-users] 2 Devices

2017-11-10 Thread Dirk Ziegelmeier
you need both calls (bind, sockopt), your code should work like this, I
think. If not, please debug and tell us why :-)


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

Re: [lwip-users] netconn send broadcast

2017-11-07 Thread Dirk Ziegelmeier
Yes, that's correct. Be aware this is not thread-safe, you should not
change that option during runtime. You should do it before binding the PCB.

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

Re: [lwip-users] Lwip tcp-stack reliability issue when using non-reliable network?

2017-11-07 Thread Dirk Ziegelmeier
Sorry for the DisableInterrupts() / EnableInterrupts() confusion, I forgot
you are running on Android in a process.


Ciao
Dirk

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

On Tue, Nov 7, 2017 at 9:07 PM, Dirk Ziegelmeier <d...@ziegelmeier.net>
wrote:

> Try implementing it as DisableInterrupts() / EnableInterrupts()
>
>
> Ciao
> Dirk
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Externally allocated memory pool for pbufs

2017-11-07 Thread Dirk Ziegelmeier
RX is OK, updated example:
http://www.nongnu.org/lwip/2_0_x/group__pbuf.html

Moving PBUFs:
http://www.nongnu.org/lwip/2_0_x/group__mempool.html#ga5b1fb3ce7942432d87cc948b1c5ed6cb

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

Re: [lwip-users] Lwip tcp-stack reliability issue when using non-reliable network?

2017-11-07 Thread Dirk Ziegelmeier
Try implementing it as DisableInterrupts() / EnableInterrupts()


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

Re: [lwip-users] 2 Devices

2017-11-07 Thread Dirk Ziegelmeier
Try SO_BINDTODEVICE socket option


Ciao
Dirk


On Tue, Nov 7, 2017 at 3:55 PM, Fabian Cenedese  wrote:

> At 15:20 07.11.2017, you wrote:
> >Hi,
> >
> >I am doing similar thing. I think I will use one thread to collect data
> from multiple devices and feed them to corresponding netif->input.
> >Don't feed data directly to tcpip_input, if you do so, make sure you pass
> the right netif to it. Anyway make sure you have two individual netif.
>
> I do have two netifs, as mentioned before, I call netif_add/setup twice.
> Reading and processing the incoming frames is one thing, sending the
> reply back over the same interface is another.
>
> >For UDP, I believe you can bind with IP_ANY to listen on same port on all
> devices. In UDP recv callback, you can find the source IP in the parameters.
>
> I already bind with sin_addr.s_addr=PP_HTONL(INADDR_ANY),
> but this fails on the second bind. Somehow makes sense
> as LwIP wouldn't know which one to give an incoming frame. But if the
> sockets were netif specific then it would be possible for both netifs to
> listen
> on the same port.
>
> >Are you working on something like a router? If so, what protocol you are
> working on and do you have any code resources to share, please?
>
> No, this is not a router but our main fieldbus CPU. One interface would be
> used for loading, communication, visualisation etc. The other interface
> could be used by the customer to access any network device, be it
> TCP/IP or Profinet, Modbus, whatever.
> The operating system is only open to our customers, sorry. But the
> LwIP part is still standard so far. But that may change now.
>
> Thanks
>
> bye  Fabi
>
>
> ___
> 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] lwipopts: TX_SINGLE_PBUF

2017-10-20 Thread Dirk Ziegelmeier
Simon tried to explain you this:

https://git.savannah.gnu.org/cgit/lwip.git/tree/src/include/lwip/opt.h#n1593

Dirk

On Fri, Oct 20, 2017 at 2:57 PM, David Gauchard  wrote:

> On ven., oct. 20, 2017 at 09:32:14 -0300, Sergio R. Caprile wrote:
> > I can comment on the ESP8266 side.
> > It does not use 1.4.1 nor 2.0.3 but a custom (heavily modified) git head
> > grabbed some time between 1.4.1 and 2.0 when there was a probable 1.5 to
> > come, as that is what they advertise on their VERSION strings.
> > They have their own sort-of-OS taking care of all the WiFi stuff and
> > providing some non-WiFi-used CPU time to the rest of the "tasks", which
> must
> > use their custom C library functions.
> >
> > But I guess you know quite better than me on this very subject, so my
> former
> > comment is probably useless for you and just for the rest of the readers.
>
> As explained,  the lwip stack that is actually and currently running on my
> esp8266 is the latest clear stable unpatched lwip2 sources.  The patched
> lwip1.4 from espressif is completely removed (check the link from my
> previous mail).  It is running quite well and solves number of problems
> linked to the tcp stack on esp8266/arduino.
>
> > AFAIK, pbufs are single (non-chained) on the Tx side and probably
> multiple
> > (chained) on the Rx side, depending on the memory allocation strategy,
> which
> > serves the purpose of avoiding memory fragmentation issues. Maybe there's
> > something I'm missing, but I think probably your needs are more on the
> alloc
> > world and not TCP/IP functions related ?
>
> pbufs are generally single pbufs, because I configured lwipopts.h as so (it
> is not working without this specific conf).  Still I have sometimes a
> sanity check which is raised:
>
> https://github.com/d-a-v/esp82xx-nonos-linklayer/blob/
> 12b7c2f0d46e0d4efdc5494f94bdd7268b627cc7/glue-lwip/lwip-git.c#L183
>
>
> > Off-topic: I gave up with that chip, I'm currently fighting the ESP32.
> > Though it still uses this custom lwIP fork, it has JTAG...
>
> esp8266/esp8285 are still great and running quite well with a proper ip
> stack :)
>
> ___
> 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] Memory Pool relocation

2017-10-15 Thread Dirk Ziegelmeier
​
extern u8_t attribute((section(".onchip_mem")))
memp_memory_PBUF_POOL_base[];


The documentation is wrong. I'll fix it.

Ciao
Dirk

Hi

>
>
> I eventually got round to testing this – but I am not sure the docs are
> correct. Here is the note in  the docs:
>
>
>
> extern u8_t attribute((section(".onchip_mem")))
> memp_memory_my_private_pool[];
>
>
>
> I could not get this to move the pool if I did:
>
>
>
> extern u8_t attribute((section(".onchip_mem"))) memp_memory_PBUF_POOL[];
>
>
>
> Having looked at the code a little more, what I then did was:
>
>
>
> ​​
> extern u8_t attribute((section(".onchip_mem")))
> memp_memory_PBUF_POOL_base[];
>
>
>
> This did seem to do the right thing.
>
>
>
> Can anyone confirm whether the first option should be the right way?
>
>
>
> Z
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] FW: Problem by sending of UDP broadcast frame

2017-10-04 Thread Dirk Ziegelmeier
http://www.nongnu.org/lwip/2_0_x/upgrading.html

(2.0.0)

  ++ Application changes:

  * Changed netif "up" flag handling to be an administrative flag (as
opposed to the previous meaning of
"ip4-address-valid", a netif will now not be used for transmission
if not up) -> even a DHCP netif
has to be set "up" before starting the DHCP client

​This information could have also be obtained by simply stepping through
your udp_sendto() until you reach the bottom of ip4_route() in a debugger.​
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Problem by sending of UDP broadcast frame

2017-10-04 Thread Dirk Ziegelmeier
set a default netif using netif_set_default()


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

Re: [lwip-users] ip_addr_copy alignment issue

2017-09-24 Thread Dirk Ziegelmeier
Packed structs imply two things: No padding inside the struct AND the
struct's location may be unaligned in memory. So when this u32 access fails
at runtime your compiler did not generate correct code for your platform.
When copying an u32 to/from a packed struct, something like memcpy needs to
be used when the processor requires aligned access.
Some ARM platforms can be configured to handle unaligned access, and there
is a gcc command line flag that tells the compiler it can assume this
capability (sorry forgot the name of the flag, something like
-munaligned-access, google it). Maybe this points you in the right
direction.


Ciao
Dirk


On Sun, Sep 24, 2017 at 2:47 PM, Ran Shalit  wrote:

> Hello,
>
> I get stuck in ip_addr_copy when called by ip_input.
> I am using MEM_ALIGNMENT 4, and packed structs.
> I tried many stuff, but nothing yet helped.
> If I try MEM_ALIGNMENT 1, I get stuck in much earlier phase.
> I'm using lwip 1.4.1 , which is a stable release as I understand.
>
> Is there any idea how this issue can be fixed ?
>
> This is the code for ip_addr_copy
> #define ip_addr_copy(dest, src) ((dest).addr = (src).addr)
>
> Best Regards,
> Ran
>
> ___
> 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] 2 packets received in tcp and passed as only 1 with doubled size

2017-09-22 Thread Dirk Ziegelmeier
Are you aware TCP is a STREAM protocol, NOT a PACKET based protocol like
UDP? The behavior sounds perfectly fine.

Dirk

On Fri, Sep 22, 2017 at 5:24 PM, gussabina  wrote:

> Hello:
>
> I'm using lwIP 1.4.1 with FreeRTOS 7.30 running on Atmel ATSAM4E, with an
> application creating a tcp (mqtt) connection to the cloud via ethernet. I
> noticed in some cases, where 2 consecutive packets are sent from the cloud
> (in a very short time between them), even when 2 TCP segments are received
> in the ethernet interface (as observed in wireshark), the stack passes only
> one packet with double size
> In this case the application fails as it's not what would expect
>
> How can this be avoided?
>
> Thanks
> Gus
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> ___
> 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] Correct way to use SNTP safely

2017-09-22 Thread Dirk Ziegelmeier
Read:
http://www.nongnu.org/lwip/2_0_x/index.html
and
http://www.nongnu.org/lwip/2_0_x/pitfalls.html


Check the "Modules" section, the APIs are separated in "Callback-style"
(tcpipthread only) and "Sequential-style" (to be used from other threads)

Ciao
Dirk

On Fri, Sep 22, 2017 at 8:51 AM, Wayne Uroda  wrote:

> My mistake.
>
> Other functions I am calling:
>
> tcpip_init
> netif_add
> netif_set_default
> netif_set_up
> dhcp_start
> dns_setserver
> netbiosns_set_name
> netbiosns_init
> sntp_setservername
> sntp_init
> netconn_*
> netbuf_*
>
> When I said the other functions use the mailbox, I guess I was referring
> to the netconn and netbuf functions, because all those other ones don't
> seem to use the mailbox.
>
> I take it any function which doesn't make use of the mailbox should be
> called on the tcp thread somehow.
> What is the preferred/easiest method of doing that?
> Am I missing some key piece of "lwip for beginners" information which I
> never read in the first place?
>
> Thanks
> - Wayne
>
>
> On Fri, Sep 22, 2017 at 3:43 PM, Simon Goldschmidt 
> wrote:
>
>> Wayne Uroda wrote:
>> >> Which functions are you talking about?
>> > I am calling only sntp_setservername and sntp_init from my code.
>>
>> Ehrm, when I aske which functions you are talking about, I was referring
>> to your "Every other lwip function I've used [..]" to see if you're
>> violating threading anywhere else.
>>
>> SNTP is a callback API application and must not be used from outside
>> tcpip_thread (unless you write your own wrapper functions). Period. Nothing
>> paranoid about that.
>>
>>
>> Simon
>>
>> ___
>> 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
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] udp_send / udp_recv thread safefy

2017-09-08 Thread Dirk Ziegelmeier
No, its not OK to call raw API functions from another thread.

See http://www.nongnu.org/lwip/2_0_x/pitfalls.html

Dirk

On Fri, Sep 8, 2017 at 12:04 PM, Ricardo Martins 
wrote:

> Hi,
>
> I'm doing some work with LWIP 2.0.2 using the raw API to send and receive
> UDP datagrams and I have a doubt regarding the thread safety of udp_send
> and udp_recv. Right now I have a single UDP PCB instance and I'm handling
> incoming datagrams in one thread using the recv callback (I assume this
> thread is the tcpip_thread) and sending UDP datagrams in another thread. Is
> this safe or should I queue my UDP transmissions using the
> tcpip_callback_with_block ?
>
> Kind regards,
> Ricardo Martins
>
> ___
> 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] IPv6 multicast support by Socket API?

2017-08-10 Thread Dirk Ziegelmeier
"We have task #14394 (Improve socket options) for this"

does not mean that somebody is or will be working on it - it is just there
so the issue is not forgotten.

Have you been able to test my patch?

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

Re: [lwip-users] IPv6 multicast support by Socket API?

2017-08-09 Thread Dirk Ziegelmeier
Andrey,

can you try my patch and tell me if it works? If not, please try to debug
it, I was not able to test it at home.

TODO: Correctly unregister at socket close, try to fix code duplication
with IGMP.

Ciao
Dirk
diff --git a/src/api/sockets.c b/src/api/sockets.c
index a50faf5..21f6481 100644
--- a/src/api/sockets.c
+++ b/src/api/sockets.c
@@ -59,7 +59,9 @@
 #include "lwip/udp.h"
 #include "lwip/memp.h"
 #include "lwip/pbuf.h"
+#include "lwip/netif.h"
 #include "lwip/priv/tcpip_priv.h"
+#include "lwip/mld6.h"
 #if LWIP_CHECKSUM_ON_COPY
 #include "lwip/inet_chksum.h"
 #endif
@@ -234,12 +236,12 @@
 #endif /* LWIP_IPV4 */
 };
 
-#if LWIP_IGMP
 /* Define the number of IPv4 multicast memberships, default is one per socket */
 #ifndef LWIP_SOCKET_MAX_MEMBERSHIPS
 #define LWIP_SOCKET_MAX_MEMBERSHIPS NUM_SOCKETS
 #endif
 
+#if LWIP_IGMP
 /* This is to keep track of IP_ADD_MEMBERSHIP calls to drop the membership when
a socket is closed */
 struct lwip_socket_multicast_pair {
@@ -256,6 +258,25 @@
 static int  lwip_socket_register_membership(int s, const ip4_addr_t *if_addr, const ip4_addr_t *multi_addr);
 static void lwip_socket_unregister_membership(int s, const ip4_addr_t *if_addr, const ip4_addr_t *multi_addr);
 static void lwip_socket_drop_registered_memberships(int s);
+#endif /* LWIP_IGMP */
+
+#if LWIP_IPV6_MLD
+/* This is to keep track of IP_JOIN_GROUP calls to drop the membership when
+   a socket is closed */
+struct lwip_socket_multicast_mld6_pair {
+  /** the socket */
+  struct lwip_sock* sock;
+  /** the interface index */
+  unsigned int if_idx;
+  /** the group address */
+  ip6_addr_t multi_addr;
+};
+
+struct lwip_socket_multicast_mld6_pair socket_ipv6_multicast_memberships[LWIP_SOCKET_MAX_MEMBERSHIPS];
+
+static int  lwip_socket_register_mld6_membership(int s, unsigned int if_idx, const ip6_addr_t *multi_addr);
+static void lwip_socket_unregister_mld6_membership(int s, unsigned int if_idx, const ip6_addr_t *multi_addr);
+static void lwip_socket_drop_registered_mld6_memberships(int s);
 #endif /* LWIP_IGMP */
 
 /** The global array of available sockets */
@@ -709,6 +730,10 @@
   /* drop all possibly joined IGMP memberships */
   lwip_socket_drop_registered_memberships(s);
 #endif /* LWIP_IGMP */
+#if LWIP_IPV6_MLD
+  /* drop all possibly joined MLD6 memberships */
+  lwip_socket_drop_registered_mld6_memberships(s);
+#endif /* LWIP_IPV6_MLD */
 
   err = netconn_delete(sock->conn);
   if (err != ERR_OK) {
@@ -3053,7 +3078,6 @@
 case IP_DROP_MEMBERSHIP:
   {
 /* If this is a TCP or a RAW socket, ignore these options. */
-/* @todo: assign membership to this socket so that it is dropped when closing the socket */
 err_t igmp_err;
 const struct ip_mreq *imr = (const struct ip_mreq *)optval;
 ip4_addr_t if_addr;
@@ -3079,6 +3103,41 @@
   }
   break;
 #endif /* LWIP_IGMP */
+#if LWIP_IPV6_MLD
+case IPV6_JOIN_GROUP:
+case IPV6_LEAVE_GROUP:
+  {
+/* If this is a TCP or a RAW socket, ignore these options. */
+err_t mld6_err;
+struct netif *netif;
+ip6_addr_t multi_addr;
+const struct ipv6_mreq *imr = (const struct ipv6_mreq *)optval;
+LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, struct ipv6_mreq, NETCONN_UDP);
+inet6_addr_to_ip6addr(_addr, >ipv6mr_multiaddr);
+netif = netif_get_by_index(imr->ipv6mr_interface);
+if (netif == NULL) {
+  err = EADDRNOTAVAIL;
+  break;
+}
+
+if (optname == IPV6_JOIN_GROUP) {
+  if (!lwip_socket_register_mld6_membership(s, imr->ipv6mr_interface, _addr)) {
+/* cannot track membership (out of memory) */
+err = ENOMEM;
+mld6_err = ERR_OK;
+  } else {
+mld6_err = mld6_joingroup_netif(netif, _addr);
+  }
+} else {
+  mld6_err = mld6_leavegroup_netif(netif, _addr);
+  lwip_socket_unregister_mld6_membership(s, imr->ipv6mr_interface, _addr);
+}
+if (mld6_err != ERR_OK) {
+  err = EADDRNOTAVAIL;
+}
+  }
+  break;
+#endif /* LWIP_IPV6_MLD */
 default:
   LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_IP, UNIMPL: optname=0x%x, ..)\n",
   s, optname));
@@ -3558,4 +3617,98 @@
   done_socket(sock);
 }
 #endif /* LWIP_IGMP */
+
+#if LWIP_IPV6_MLD
+/** Register a new MLD6 membership. On socket close, the membership is dropped automatically.
+ *
+ * ATTENTION: this function is called from tcpip_thread (or under CORE_LOCK).
+ *
+ * @return 1 on success, 0 on failure
+ */
+static int
+lwip_socket_register_mld6_membership(int s, unsigned int if_idx, const ip6_addr_t *multi_addr)
+{
+  struct lwip_sock *sock = get_socket(s);
+  int i;
+
+  if (!sock) {
+return 0;
+  }
+
+  for (i = 0; i < LWIP_SOCKET_MAX_MEMBERSHIPS; i++) {
+if (socket_ipv6_multicast_memberships[i].sock == NULL) {
+  socket_ipv6_multicast_memberships[i].sock   = sock;

Re: [lwip-users] how to set the link up

2017-07-06 Thread Dirk Ziegelmeier
Seriously, Max, if I send you a link to the lwIP docs, the I can at least
expect you
​ READ AND try HARD to UNDERSTAND the docs.​
You really can answer that question by yourself.​

Read the page that I sent you, and several other pages in the docs, there
are many questions answered in there (especially
http://www.nongnu.org/lwip/2_0_x/pitfalls.html)

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

Re: [lwip-users] seting up ip address after initialization

2017-07-06 Thread Dirk Ziegelmeier
http://www.nongnu.org/lwip/2_0_x/group__netifapi__netif.html

​HTH
Dirk


On Thu, Jul 6, 2017 at 12:16 PM, massimiliano cialdi <
massimiliano.cia...@powersoft.it> wrote:

> I have to set the ip address after initialization.
>
> I guess I have to pass 0.0.0.0 as ip address, netmask and gw to call to
> netif_add().
>
> I wonder which api (thread safe?) to call to set the proper ip address at
> a later time.
>
>
> best regards
>
> Max
>
>
>
> ___
> 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] Example of changes needed to switch from 1.4.1 to 2.0.1

2017-05-23 Thread Dirk Ziegelmeier
TiVaWare = TI Vapor Ware? ;-)

Am 23.05.2017 10:27 nachm. schrieb "goldsi...@gmx.de" :

> Wow, this is so horrible! I really don't know why people come up with this
> idea of including C files in other C files.
>
> Funny enough, it seems to work on the lwIP sources without problems, does
> it?
>
> Keep in mind though that this is *not* how the sources were intended to
> use and I'm not prepared to fix naming clashes (if there should be any in
> the future when including C files in C files).
>
> I'd strongly suggest to fix the build process here!
>
> Simon
>
>
> Amit Ashara wrote:
>
> Hello Billy,
>
> Try the following two files.
>
> Regards
> Amit
>
> On Fri, May 19, 2017 at 4:30 PM, billium  wrote:
>
>> Thanks Simon
>>
>> This is what I mean, this is tivaware/utils/lwiplib.c
>>
>> //**
>> ***
>> //
>> // lwiplib.c - lwIP TCP/IP Library Abstraction Layer.
>> //
>> // Copyright (c) 2008-2017 Texas Instruments Incorporated.  All rights
>> reserved.
>> // Software License Agreement
>> //
>> // Texas Instruments (TI) is supplying this software for use solely and
>> // exclusively on TI's microcontroller products. The software is owned by
>> // TI and/or its suppliers, and is protected under applicable copyright
>> // laws. You may not combine this software with "viral" open-source
>> // software in order to form a larger program.
>> //
>> // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
>> // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
>> // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
>> // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
>> // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
>> // DAMAGES, FOR ANY REASON WHATSOEVER.
>> //
>> // This is part of revision 2.1.4.178 of the Tiva Utility Library.
>> //
>> //**
>> ***
>>
>> //**
>> ***
>> //
>> // Ensure that the lwIP compile time options are included first.
>> //
>> //**
>> ***
>> #include 
>> #include 
>> #include "utils/lwiplib.h"
>>
>> //**
>> ***
>> //
>> // Ensure that ICMP checksum offloading is enabled; otherwise the TM4C129
>> // driver will not operate correctly.
>> //
>> //**
>> ***
>> #ifndef LWIP_OFFLOAD_ICMP_CHKSUM
>> #define LWIP_OFFLOAD_ICMP_CHKSUM 1
>> #endif
>>
>> //**
>> ***
>> //
>> // Include lwIP high-level API code.
>> //
>> //**
>> ***
>> #include "third_party/lwip-1.4.1/src/api/api_lib.c"
>> #include "third_party/lwip-1.4.1/src/api/api_msg.c"
>> #include "third_party/lwip-1.4.1/src/api/err.c"
>> #include "third_party/lwip-1.4.1/src/api/netbuf.c"
>> #include "third_party/lwip-1.4.1/src/api/netdb.c"
>> #include "third_party/lwip-1.4.1/src/api/netifapi.c"
>> #include "third_party/lwip-1.4.1/src/api/sockets.c"
>> #include "third_party/lwip-1.4.1/src/api/tcpip.c"
>>
>> //**
>> ***
>> //
>> // Include the core lwIP TCP/IP stack code.
>> //
>> //**
>> ***
>> #include "third_party/lwip-1.4.1/src/core/def.c"
>> #include "third_party/lwip-1.4.1/src/core/dhcp.c"
>> #include "third_party/lwip-1.4.1/src/core/dns.c"
>> #include "third_party/lwip-1.4.1/src/core/init.c"
>> #include "third_party/lwip-1.4.1/src/core/mem.c"
>> #include "third_party/lwip-1.4.1/src/core/memp.c"
>> #include "third_party/lwip-1.4.1/src/core/netif.c"
>> #include "third_party/lwip-1.4.1/src/core/pbuf.c"
>> #include "third_party/lwip-1.4.1/src/core/raw.c"
>> #include "third_party/lwip-1.4.1/src/core/stats.c"
>> #include "third_party/lwip-1.4.1/src/core/sys.c"
>> #include "third_party/lwip-1.4.1/src/core/tcp.c"
>> #include "third_party/lwip-1.4.1/src/core/tcp_in.c"
>> #include "third_party/lwip-1.4.1/src/core/tcp_out.c"
>> #include "third_party/lwip-1.4.1/src/core/timers.c"
>> #include "third_party/lwip-1.4.1/src/core/udp.c"
>>
>> //**
>> ***
>> //
>> // Include the IPV4 code.
>> //
>> //**
>> ***
>> #include "third_party/lwip-1.4.1/src/core/ipv4/autoip.c"
>> #include "third_party/lwip-1.4.1/src/core/ipv4/icmp.c"
>> #include "third_party/lwip-1.4.1/src/core/ipv4/igmp.c"
>> #include "third_party/lwip-1.4.1/src/core/ipv4/inet.c"
>> #include 

Re: [lwip-users] lwip 2.0.2 + freertos + ARM7

2017-05-11 Thread Dirk Ziegelmeier
The two APIs can coexist.

regarding your code: Sorry, this code is so horribly wrong :-( I am sorry
for being rude - you also need a LOT of education in C code. And, if your
compiler compiles this, the warning settings are way too relaxed or you
really should read and fix all compiler warnings.

​Sorry, you have a too long way to go there, can't help you there.​

Dirk



On Thu, May 11, 2017 at 2:10 PM,
​​
Werner Motz  wrote:

> I cannot because my webserver is already running with raw api.
>
>
>
> In my Send task I try now…
>
>
>
> tcpip_callback(tcp_write(pcb, ucrecBuff, supersize, TCP_WRITE_FLAG_COPY),
> NULL);
>
> tcpip_callback(tcp_output(pcb), NULL);
>
>
>
> but without success. After the first message sent the system crashed.
>
> I think I am doing something horrible wrong :D
>
>
>
> ___
> 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 2.0.2 + freertos + ARM7

2017-05-11 Thread Dirk Ziegelmeier
Use socket API and you can use threads without problems.

Possible alternative:
http://www.nongnu.org/lwip/2_0_x/group__tcp__raw.html#gafba47015098ed7ce523dcf7bdf70f7e5

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

Re: [lwip-users] lwip 2.0.2 + freertos + ARM7

2017-05-11 Thread Dirk Ziegelmeier
Hello Werner,

the following sentences are NOT meant in a harsh way, but as a good and
polite advice to you:

You really need to get educated in threading, locking and interrupt issues
when you develop for a multithreaded system. Without understanding these,
you will quite surely end up with a system that "usually works" but has
occasional hiccups a few times a day.

The question you are asking is out of scope of this mailing list, it is a
question about general threading design in an embedded system. Please
understand I don't want to help you there, that would consume too much
time. It is not a question that can be answered shortly in a few sentences
and without understanding your application.

If you use threads, you may want to use netconn or socket API if that's
easier for you. You still can use the callback API, but you need to use
tcpip_callback() or LOCK_TCPIP_CORE (if you configured lwIP to use core
locking) to sync with lwIP thread.

Dirk

On Thu, May 11, 2017 at 12:07 PM, Werner Motz <m...@smart-e-tech.de> wrote:

> Thank u for your answer.
>
> But what is the proper way to use tcp_write() and tcp_output()? Where can
> I use them?
>
> Would it be correct to do:
>
>
>
> LOCK_TCPIP_CORE();
>
> tcp_write();
>
> tcp_output();
>
> UNLOCK_TCPIP_CORE();
>
>
>
> If I do so, how can I ensure, that I can still receiving data? Don’t I
> block the RX side?
>
> Sorry, I am a noob but how can I ensure that I am in the tcpip thread?
>
>
>
>
>
> *Von:* lwip-users [mailto:lwip-users-bounces+motz=smart-e-tech.de@nongnu.
> org] *Im Auftrag von *Dirk Ziegelmeier
> *Gesendet:* Mittwoch, 10. Mai 2017 19:04
> *An:* Mailing list for lwIP users
> *Betreff:* Re: [lwip-users] lwip 2.0.2 + freertos + ARM7
>
>
>
> Sounds like you are calling lwIP functions from another thread than the
> lwIP thread, in your case the CAN thread.
>
> See
> http://www.nongnu.org/lwip/2_0_x/pitfalls.html
>
> Dirk
>
>
>
> ___
> 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 2.0.2 + freertos + ARM7

2017-05-10 Thread Dirk Ziegelmeier
Sounds like you are calling lwIP functions from another thread than the
lwIP thread, in your case the CAN thread.

See
http://www.nongnu.org/lwip/2_0_x/pitfalls.html

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

Re: [lwip-users] DHCP fails ?

2017-05-10 Thread Dirk Ziegelmeier
> After checking/debugging I found that if I add a call to function
> netif_set_link_down(netif); just before I check for link and
>
> netif_set_link_up(netif); … DHCP task will work fine
>
>
>
​Sounds correct - from the UPGRADING document (
https://git.savannah.gnu.org/cgit/lwip.git/tree/UPGRADING):

Changed netif "up" flag handling to be an administrative flag (as opposed
to the previous meaning of "ip4-address-valid", a netif will now not be
used for transmission if not up) -> even a DHCP netif has to be set "up"
before starting the DHCP client


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

Re: [lwip-users] SNTP example?

2017-04-29 Thread Dirk Ziegelmeier
Look AG lwip contrib repository, Unix port, simhost.c. There is an example
in there.

Dirk

On Apr 29, 2017 23:17, "Mike Rosing"  wrote:

Hello,

I have ported 2.0.2 to the TI C6748 and finally got DHCP to get an
address.  The next thing I'd like to do is use sntp.  What do I do after
calling sntp_init()?

I did add sys_now() so there is a millisecond timer running.  The port is
copied from the version 1.3.2 example given in the C6748 Starterware.  I'm
pretty sure it all works, I'm just clueless as how to use the sntp.c
subroutines so I can set my RTC once an hour.

Any help/pointers on how to use the code would be greatly appreciated.
Mike

___
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] Connect two machines running LWIP applications via WLAN

2017-04-04 Thread Dirk Ziegelmeier
I sent this link because of the first answer:


It is not possible to bridge between wireless (client a.k.a. station mode)
and wired interfaces according to this thread on linux-ath5k-devel

.
One should set up NAT instead:
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Connect two machines running LWIP applications via WLAN

2017-04-01 Thread Dirk Ziegelmeier
http://serverfault.com/questions/152363/bridging-wlan0-to-eth0


Ciao
Dirk
>
> 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] Question regarding mdns responder

2017-03-21 Thread Dirk Ziegelmeier
from mdns.c:

 * Things left to implement:
 * -
 *
 * - Probing/conflict resolution
[...]

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

Re: [lwip-users] lwip 1.4.1 -> 2.0.1: problem with dhcp

2017-03-15 Thread Dirk Ziegelmeier
no, you just need to enable the interface during system startup by calling
netif_set_up().

NO_SYS example:
http://www.nongnu.org/lwip/2_0_x/group__lwip__nosys.html


Ciao
Dirk

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

On Wed, Mar 15, 2017 at 8:35 AM, <markus.l...@gmx.ch> wrote:

> Hi Dirk
>
> Thank you for your answer.
>
> > http://www.nongnu.org/lwip/2_0_x/upgrading.html
>
> I don't really understand that point. Do I have to change my 
> InitEthernetAdapter
> function like that?
>
>
> // Start with dhcp
>
> if (_useDhcp)
>
> {
>
>   if (dhcp_start(&_netif) == ERR_OK)
>
>   {
>
> netif_set_up(&_netif);
>
>   }
>
> }
>
> Thanks
>
> Markus
>
>
> *Gesendet:* Dienstag, 14. März 2017 um 15:45 Uhr
> *Von:* "Dirk Ziegelmeier" <d...@ziegelmeier.net>
> *An:* "Mailing list for lwIP users" <lwip-users@nongnu.org>
> *Betreff:* Re: [lwip-users] lwip 1.4.1 -> 2.0.1: problem with dhcp
> Maybe this is missing:
>
> http://www.nongnu.org/lwip/2_0_x/upgrading.html
>
>
>  * Changed netif "up" flag handling to be an administrative flag (as opposed 
> to the previous meaning of"ip4-address-valid", a netif will now not be 
> used for transmission if not up) -> even a DHCP netifhas to be set "up" 
> before starting the DHCP client
>
>
> ___ 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
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] lwip 1.4.1 -> 2.0.1: problem with dhcp

2017-03-14 Thread Dirk Ziegelmeier
Maybe this is missing:

http://www.nongnu.org/lwip/2_0_x/upgrading.html

 * Changed netif "up" flag handling to be an administrative flag (as
opposed to the previous meaning of
"ip4-address-valid", a netif will now not be used for transmission
if not up) -> even a DHCP netif
has to be set "up" before starting the DHCP client
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Upgrading from 1.4.x to 2.0.2

2017-03-14 Thread Dirk Ziegelmeier
I'd recommend to use the Filelists.mk if you use make as a build system,
then you don't have to worry about added/removed files in the future.


Ciao
Dirk


Also, note that 2.0.0 has added/removed/moved files, so you need to adjust
your build process/project.

>
> Simon
>
>


> ___
> 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 with router

2017-02-16 Thread Dirk Ziegelmeier
Did you check this?

http://www.nongnu.org/lwip/2_0_0/upgrading.html

Especially the netif_set_up() part?

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

Re: [lwip-users] sporadic PCB corruption

2017-01-30 Thread Dirk Ziegelmeier
That call stack does not mean the corruption happens in this call stack.

For debugging, can you simply call memp_free on the tcp PCB from your
application thread? If the sanity check already hits you there, then it is
most probably your application's problem.

If you are on a platform with HW breakpoints, put a WRITE breakpoint on the
address range right behind the TCP PCB that is sanity checked in
do_memp_free_pool. You will immediately see who writes in there.

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

Re: [lwip-users] lwip_sendto hanging with lwip 2.0

2017-01-24 Thread Dirk Ziegelmeier
Calling sys_timeout() results in send_actual_pkt being called back from
TCPIP thread. You must not call sequencial style functions from TCPIP
thread.

http://www.nongnu.org/lwip/2_0_0/group__sequential__api.html says: "More
overhead, but can be called from any thread except TCPIP thread."​

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

Re: [lwip-users] Assertions when using DHCP when using LWIP 2.0

2017-01-23 Thread Dirk Ziegelmeier
And read this:

http://www.nongnu.org/lwip/2_0_0/pitfalls.html

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

Re: [lwip-users] Using in a single thread with NO_SYS = 1

2017-01-08 Thread Dirk Ziegelmeier
Yes, but read and apply these:

http://www.nongnu.org/lwip/2_0_0/pitfalls.html
http://www.nongnu.org/lwip/2_0_0/group__lwip__nosys.html

Pay especially attention to your netif driver, it must not call
netif->input() from IRQ context! See example code on the page of the second
link above.

Also note you need a separate thread for lwIP, which needs to periodically
poll the packet queue that is filled by netif driver from IRQ context and
periodically call sys_check_timeouts() to make lwIP timers work.
If you do it the simple way, this creates continuous CPU load. If you put
work in it, you can block the lwIP thread on packet queue AND on the expiry
time of the next timeout (= you need to implement the timeout mechanism by
yourself).

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

Re: [lwip-users] MEMP_POOL_256 undeclared when enabling custom pools

2017-01-05 Thread Dirk Ziegelmeier
Can you please post more detail of the error message? e.g. which file is
being compiled.
​I use custom mempool in my application, and ​I don't see this error
message.


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

Re: [lwip-users] TFTP init

2016-12-20 Thread Dirk Ziegelmeier
The unix simhost has a working example in contrib

http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git/tree/ports/unix/unixsim/simhost.c

Dirk

On Tue, Dec 20, 2016 at 8:09 PM, Nicholas Richard  wrote:

>
> Hello,
>
> I’m looking to get the TFTP server up and running, but I’m having a hard
> time understanding the initialization function.  I’m still somewhat new to
> lwip so I tried looking up an example, but have only seen the older methods
> where the init function had no parameters.  I’m guessing this way of
> implementing the server is new to 2.0.0?  If someone could point me in the
> right direction, with either an example or explanation, that would be
> helpful.
>
> What I’d love to have is FTP, since that is what my old system had, but it
> seems like only TFTP is supported since this is a lightweight tool after
> all.  It still has the file transfer, which is what I’m after, since after
> it is transferred, I will be replacing an image file somehow…
>
> Thanks in advance for any and all help.
>
> Regards, Nick
>
>
> 
> =
> The information contained in this e-mail, including all of its
> attachments, is confidential and proprietary information of IPG Photonics
> and its affiliates and intended only for the use of the individual or
> entity named above. If the reader of this message is not the intended
> recipient, or the employee or agent responsible to deliver it to the
> intended recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited.
> If you have received this communication in error, please immediately
> notify the sender by telephone or e-mail, and destroy this communication
> and all copies.
> Thank you.
> 
> =
> This Email has been scanned for all viruses by IPG Photonics Email
> Scanning Services.
>
> ___
> 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] 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

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 <adity...@marvell.com> 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 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 <nir...@marvell.com> 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] UDP bind error due to address and port reuse

2016-12-15 Thread Dirk Ziegelmeier
https://lmgtfy.com/?q=pack+dropped%2C+no+space

​In other words: Please debug, search the web and spend some time trying to
figure out by yourself before asking others.​


On Thu, Dec 15, 2016 at 9:25 AM, Surya Chaitanya <csu...@cdot.in> wrote:

> Hi Dirk,
>
> udp_sendto() function stops sending after sending few times, i.e., the
> packets are
> not reaching the destination. The error message says "Error on udp_send: -1
> pack dropped, no space" . Why does this happen?
>
> Regards,
> Surya
>
>
> On Tue, 13 Dec 2016 12:49:25 +0100, Dirk Ziegelmeier wrote
> > The arguments to the function are the *source* IP/Port tuple of the
> request.
> >
> > If you use udp_sendto() then the the *reply *packet has
> >
> >- Source IP: IP of your lwIP device
> >- Source port: Port in your lwIP device ("x")
> >- Destination IP: source IP of the request = addr parameter of
> function
> >- Destination port: source port of the request = port parameter of the
> >function
> >
> > Dirk
> >
> > On Tue, Dec 13, 2016 at 6:58 AM, Surya Chaitanya <csu...@cdot.in> wrote:
> >
> > > Hi Dirk,
> > >
> > > I tried out the few lines of code like you suggested. It works.
> However,
> > > what I
> > > don't understand is how it works, i.e., how the port parameter in the
> > > function is
> > > the port sending the reply. Could you plz. explain. Thank You.
> > >
> > > Regards,
> > > Surya
> > >
> > > On Wed, 7 Dec 2016 11:43:59 +0100, Dirk Ziegelmeier wrote
> > > > Use one UDP PCB, bind it to IPADDR_ANY and port x.
> > > >
> > > > Use udp_sendto() to send to any IP/port combination.
> > > > http://www.nongnu.org/lwip/2_0_0/group__udp__raw.html
> > > >
> > > > You get the src address/port of any request in your receive callback:
> > > >
> > > > void my_udp_recv_fn (void *arg, struct udp_pcb
> > > > <http://www.nongnu.org/lwip/2_0_0/structudp__pcb.html> *pcb, struct
> pbuf
> > > > <http://www.nongnu.org/lwip/2_0_0/structpbuf.html> *p, const
> ip_addr_t
> > > >
> > > <http://www.nongnu.org/lwip/2_0_0/group__ipaddr.html#
> > > ga44f9ada14c65d17aecf802d82eb27
> > > 3c5>
> > > > *addr, u16_t port)
> > > > {
> > > >[create new pbuf with response]
> > > >udp_sendto(pcb, response_pbuf, addr, port);
> > > > [UTF-8?][UTF-8?]​}
> > > >
> > > > [UTF-8?][UTF-8?]​Dirk
> > > > [UTF-8?][UTF-8?]​
> > >
> > >
> > > Disclaimer:
> > > --
> > > This email and any files transmitted with it are confidential and
> intended
> > > solely
> > > for
> > > the use of the individual or entity to whom they are addressed.  If
> you
> > > are not the
> > > intended recipient you are notified that disclosing, copying,
> distributing
> > > or taking
> > > any
> > > action in reliance on the contents of this information is strictly
> > > prohibited. The
> > > sender does not accept liability for any errors or omissions in the
> > > contents of this
> > > message, which arise as a result of e-mail transmission.
> > >
> > > --
> > > Open WebMail Project (http://openwebmail.org)
> > >
> > >
> > > ___
> > > lwip-users mailing list
> > > lwip-users@nongnu.org
> > > https://lists.nongnu.org/mailman/listinfo/lwip-users
> > >
>
>
> Disclaimer:
> --
> This email and any files transmitted with it are confidential and intended
> solely
> for
> the use of the individual or entity to whom they are addressed.  If you
> are not the
> intended recipient you are notified that disclosing, copying, distributing
> or taking
> any
> action in reliance on the contents of this information is strictly
> prohibited. The
> sender does not accept liability for any errors or omissions in the
> contents of this
> message, which arise as a result of e-mail transmission.
>
> --
> Open WebMail Project (http://openwebmail.org)
>
>
> ___
> 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] UDP bind error due to address and port reuse

2016-12-13 Thread Dirk Ziegelmeier
The arguments to the function are the *source* IP/Port tuple of the request.

If you use udp_sendto() then the the *reply *packet has

   - Source IP: IP of your lwIP device
   - Source port: Port in your lwIP device ("x")
   - Destination IP: source IP of the request = addr parameter of function
   - Destination port: source port of the request = port parameter of the
   function

Dirk


On Tue, Dec 13, 2016 at 6:58 AM, Surya Chaitanya <csu...@cdot.in> wrote:

> Hi Dirk,
>
> I tried out the few lines of code like you suggested. It works. However,
> what I
> don't understand is how it works, i.e., how the port parameter in the
> function is
> the port sending the reply. Could you plz. explain. Thank You.
>
> Regards,
> Surya
>
> On Wed, 7 Dec 2016 11:43:59 +0100, Dirk Ziegelmeier wrote
> > Use one UDP PCB, bind it to IPADDR_ANY and port x.
> >
> > Use udp_sendto() to send to any IP/port combination.
> > http://www.nongnu.org/lwip/2_0_0/group__udp__raw.html
> >
> > You get the src address/port of any request in your receive callback:
> >
> > void my_udp_recv_fn (void *arg, struct udp_pcb
> > <http://www.nongnu.org/lwip/2_0_0/structudp__pcb.html> *pcb, struct pbuf
> > <http://www.nongnu.org/lwip/2_0_0/structpbuf.html> *p, const ip_addr_t
> >
> <http://www.nongnu.org/lwip/2_0_0/group__ipaddr.html#
> ga44f9ada14c65d17aecf802d82eb27
> 3c5>
> > *addr, u16_t port)
> > {
> >[create new pbuf with response]
> >udp_sendto(pcb, response_pbuf, addr, port);
> > [UTF-8?]​}
> >
> > [UTF-8?]​Dirk
> > [UTF-8?]​
>
>
> Disclaimer:
> --
> This email and any files transmitted with it are confidential and intended
> solely
> for
> the use of the individual or entity to whom they are addressed.  If you
> are not the
> intended recipient you are notified that disclosing, copying, distributing
> or taking
> any
> action in reliance on the contents of this information is strictly
> prohibited. The
> sender does not accept liability for any errors or omissions in the
> contents of this
> message, which arise as a result of e-mail transmission.
>
> --
> Open WebMail Project (http://openwebmail.org)
>
>
> ___
> 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] UDP bind error due to address and port reuse

2016-12-08 Thread Dirk Ziegelmeier
Why don't you simply try out to program the 5 lines of code that I
recommended you? Then you would already know whether it works or (if it
does not work) provide a better description what the problem is.

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

Re: [lwip-users] UDP bind error due to address and port reuse

2016-12-07 Thread Dirk Ziegelmeier
Use one UDP PCB, bind it to IPADDR_ANY and port x.

Use udp_sendto() to send to any IP/port combination.
http://www.nongnu.org/lwip/2_0_0/group__udp__raw.html

You get the src address/port of any request in your receive callback:

void my_udp_recv_fn (void *arg, struct udp_pcb
 *pcb, struct pbuf
 *p, const ip_addr_t

*addr, u16_t port)
{
   [create new pbuf with response]
   udp_sendto(pcb, response_pbuf, addr, port);
​}

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

Re: [lwip-users] Upgrading lwip 1.4.1 to 2.0.0 pbuf (or other) issue?

2016-12-05 Thread Dirk Ziegelmeier
The "udp_send: No route to 192.168.101.10" sounds like there is an explicit
netif_set_up() is missing.
Also check whether netif_set_link_up()/netif_set_link_down() is called
somewhere.

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

Re: [lwip-users] Issue in err.c for lwIP 2.0.0

2016-11-30 Thread Dirk Ziegelmeier
No, the solution is in errno.h:

Choose one of:

- #define LWIP_PROVIDE_ERRNO 1
- #define LWIP_ERRNO_INCLUDE "path/my_header_file_containing_errno.h"

HTH
Dirk


On Wed, Nov 30, 2016 at 7:45 PM, Amit Ashara  wrote:

> Hello All,
>
> When integrating FreeRTOS with lwIP 2.0.0 the following gives an error for
> missing defines.
>
> #if !NO_SYS
> /** Table to quickly map an lwIP error (err_t) to a socket error
>   * by using -err as an index */
> static const int err_to_errno_table[] = {
>   0, /* ERR_OK  0  No error, everything OK. */
>   ENOMEM,/* ERR_MEM-1  Out of memory error. */
>   ENOBUFS,   /* ERR_BUF-2  Buffer error.*/
>   EWOULDBLOCK,   /* ERR_TIMEOUT-3  Timeout  */
>   EHOSTUNREACH,  /* ERR_RTE-4  Routing problem. */
>   EINPROGRESS,   /* ERR_INPROGRESS -5  Operation in progress*/
>   EINVAL,/* ERR_VAL-6  Illegal value.   */
>   EWOULDBLOCK,   /* ERR_WOULDBLOCK -7  Operation would block.   */
>   EADDRINUSE,/* ERR_USE-8  Address in use.  */
>   EALREADY,  /* ERR_ALREADY-9  Already connecting.  */
>   EISCONN,   /* ERR_ISCONN -10 Conn already established.*/
>   ENOTCONN,  /* ERR_CONN   -11 Not connected.   */
>   -1,/* ERR_IF -12 Low-level netif error*/
>   ECONNABORTED,  /* ERR_ABRT   -13 Connection aborted.  */
>   ECONNRESET,/* ERR_RST-14 Connection reset.*/
>   ENOTCONN,  /* ERR_CLSD   -15 Connection closed.   */
>   EIO/* ERR_ARG-16 Illegal argument.*/
> };
> #endif /* !NO_SYS */
>
> #if !NO_SYS
> int
> err_to_errno(err_t err)
> {
>   if ((err > 0) || (-err >= (err_t)LWIP_ARRAYSIZE(err_to_errno_table))) {
> return EIO;
>   }
>   return err_to_errno_table[-err];
> }
> #endif /* !NO_SYS */
>
> The assumption is that if NO_SYS is 0, or an RTOS is used, the socket
> model will be used. However when not using the socket model this is not
> true. Instead the following should be done (in my opinion)
>
> #if !NO_SYS
> #if LWIP_SOCKET
> /** Table to quickly map an lwIP error (err_t) to a socket error
>   * by using -err as an index */
> static const int err_to_errno_table[] = {
>   0, /* ERR_OK  0  No error, everything OK. */
>   ENOMEM,/* ERR_MEM-1  Out of memory error. */
>   ENOBUFS,   /* ERR_BUF-2  Buffer error.*/
>   EWOULDBLOCK,   /* ERR_TIMEOUT-3  Timeout  */
>   EHOSTUNREACH,  /* ERR_RTE-4  Routing problem. */
>   EINPROGRESS,   /* ERR_INPROGRESS -5  Operation in progress*/
>   EINVAL,/* ERR_VAL-6  Illegal value.   */
>   EWOULDBLOCK,   /* ERR_WOULDBLOCK -7  Operation would block.   */
>   EADDRINUSE,/* ERR_USE-8  Address in use.  */
>   EALREADY,  /* ERR_ALREADY-9  Already connecting.  */
>   EISCONN,   /* ERR_ISCONN -10 Conn already established.*/
>   ENOTCONN,  /* ERR_CONN   -11 Not connected.   */
>   -1,/* ERR_IF -12 Low-level netif error*/
>   ECONNABORTED,  /* ERR_ABRT   -13 Connection aborted.  */
>   ECONNRESET,/* ERR_RST-14 Connection reset.*/
>   ENOTCONN,  /* ERR_CLSD   -15 Connection closed.   */
>   EIO/* ERR_ARG-16 Illegal argument.*/
> };
> #endif /* LWIP_SOCKET */
> #endif /* !NO_SYS */
>
> #if !NO_SYS
> #if LWIP_SOCKET
> int
> err_to_errno(err_t err)
> {
>   if ((err > 0) || (-err >= (err_t)LWIP_ARRAYSIZE(err_to_errno_table))) {
> return EIO;
>   }
>   return err_to_errno_table[-err];
> }
> #endif /* LWIP_SOCKET */
> #endif /* !NO_SYS */
>
> Regards
> Amit Ashara
>
> ___
> 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] Issue in arch.h for lwIP 2.0.0

2016-11-30 Thread Dirk Ziegelmeier
Since it was already included in several lwIP .c/.h files, I simply decided
to move it to a central place: arch.h.

So my change should not break anything or make lwIP less portable as it was
before.

Dirk

On Wed, Nov 30, 2016 at 11:07 AM, Simon Goldschmidt 
wrote:

> Freddie Chopin wrote:
> > It was behaving the same way in the git version prior to 2.0.0 and I
> > guess the "standard" approach to that was to include  in your
> > arch/cc.h file. I think that such issue was reported to the mailing
> > list in the past and that was the suggested approach.
>
> It was like that some years ago, but sicne by now, most embedded compilers
> support these standard files, we decided to use them and to let people
> missing
> them emulate them...
>
>
> Simon
>
> ___
> 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] Issue in arch.h for lwIP 2.0.0

2016-11-29 Thread Dirk Ziegelmeier
I added it, thanks for reporting!

​
http://git.savannah.gnu.org/cgit/lwip.git/commit/?id=182d7c138a5b845c74b7d364ee07af6105d8e786

Dirk

On Tue, Nov 29, 2016 at 10:19 PM, Amit Ashara  wrote:

> Hello All,
>
> I am using the ARM Compiler from Code Composer Studio and while updating
> lwIP from 1.4.1 to 2.0.0, I ran into a compilation issue. I get an error
> for size_t being undefined. Tracing the issue I was able to go past the
> issue by adding stdlib to arch.h
>
> #if !LWIP_NO_STDINT_H
> #include 
> #include 
> typedef uint8_t   u8_t;
> typedef int8_ts8_t;
> typedef uint16_t  u16_t;
> typedef int16_t   s16_t;
> typedef uint32_t  u32_t;
> typedef int32_t   s32_t;
> typedef uintptr_t mem_ptr_t;
> #endif
>
> "D:/ti/TivaWare_C_Series-2.1.3.156/third_party/lwip-2.0.0/src/include/lwip/def.h",
> line 124: error #20: identifier "size_t" is undefined
>
> Can any of the lwIP developers confirm if this is expected issue?
>
> As a side note: after making the change lwIP 2.0.0 works great with TM4C
> devices.
>
> Thanks and Regards
> Amit Ashara
>
> ___
> 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_VERSION in lwIP 2.0.0

2016-11-20 Thread Dirk Ziegelmeier
LWIP_VERSION_RC has changed from 2 (RC2) to 255 (RELEASE)

So your macro should be OK. Is there something else that may be wrong?


Ciao
Dirk

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

On Sun, Nov 20, 2016 at 3:19 PM, bernard <bernard.xi...@gmail.com> wrote:

> Hi,
> I have just ported the lwIP 2.0.0 to RT-Thread RTOS. I need to keep
> multi-version of lwIP in other source files, therefore I should
> use LWIP_VERSION to tell the different version of lwIP.
>
> However, I found there is something wrong with LWIP_VERSION. For example,
> I can not use following code to tell the different version:
> #if ( (LWIP_VERSION) < ((2U << 24) | (0U << 16) | (0U << 8) |
> (LWIP_VERSION_RC)) )
> ...
> #endif
>
> And the lwIP 2.0.0 RC2 version is OK. Any update? Thank you.
>
>
>
>
> Best Regards,
> Bernard Xiong
>
>
> ___
> 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] LLDP Implementation for 1.4.1

2016-11-12 Thread Dirk Ziegelmeier
Yes: I saw it only sends LLDP frames in regular intervals.

>From what I know about LLDP (I implemented a Profinet CC-B device where
LLDP is mandatory), an "LLDP implementation" also needs to receive LLDP
frames and present the received neighborhood info via SNMP LLDP MIBs. This
is way more work than just sending LLDP frames.

So IMHO, your LLDP implementation is not that useful - or am I wrong with
my assumption about LLDP reception? Are there use cases where sending LLDP
frames is enough?



Ciao
Dirk

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

On Fri, Nov 11, 2016 at 5:07 PM, Amit Ashara <ashara.a...@gmail.com> wrote:

> Hello All
>
> Did anyone have a look at the lldp code base?
>
> Regards
> Amit Ashara
>
> On Sat, Nov 5, 2016 at 12:57 AM, Amit Ashara <ashara.a...@gmail.com>
> wrote:
>
>> Hello All,
>>
>> The Manifest has been updated now and the new package is available for
>> download.
>>
>> http://www.ti.com/lit/zip/spmc023
>>
>> Regards
>> Amit Ashara
>>
>> On Wed, Nov 2, 2016 at 1:08 PM, Amit Ashara <ashara.a...@gmail.com>
>> wrote:
>>
>>> Hello Simon,
>>>
>>> The issue was with the License Option that we had used. The same is
>>> being now under correction and I would upload a new package with the
>>> correct License file.
>>>
>>> Regards
>>> Amit Ashara
>>>
>>> On Wed, Nov 2, 2016 at 11:02 AM, Amit Ashara <ashara.a...@gmail.com>
>>> wrote:
>>>
>>>> Hello Simon
>>>>
>>>> Thanks for the quick feedback. I am clarifying the same with the Legal
>>>> team.
>>>>
>>>> Regards
>>>> Amit Ashara
>>>>
>>>>
>>>> On Wed, Nov 2, 2016 at 10:39 AM, Simon Goldschmidt <goldsi...@gmx.de>
>>>> wrote:
>>>>
>>>>> Amit Ashara wrote:
>>>>> > The LLDP package is now online at the following link
>>>>> > http://www.ti.com/lit/zip/spmc023
>>>>> > There is a short ReadMe on integrating the LLDP into the LwIP and
>>>>> the application layer. I hope it is useful for others.
>>>>>
>>>>> Excerpt from the docx in the zip:
>>>>>
>>>>> "any redistribution and use of the source code, including any resulting
>>>>> derivative works, are licensed by TI for use only with TI Devices"
>>>>>
>>>>> Being like that, I can't even have a look at the sources... :-(
>>>>> Interestingly, the source code files have a different license included
>>>>> ;-)
>>>>>
>>>>>
>>>>> Simon
>>>>>
>>>>> ___
>>>>> 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
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] LLDP Implementation for 1.4.1

2016-10-23 Thread Dirk Ziegelmeier
Just post it as a patch at savannah, we'll see what to do then. Hope this
is OK for you.

Dirk

On Sat, Oct 22, 2016 at 3:56 AM, Amit Ashara  wrote:

> Hello All
>
> The LLDP base implementation for lwIP 1.4.1 is ready and will be released
> on or before Oct 28, 2016. I wanted to check back with the user group if
> some form of ReadMe document on integrating it an application is required.
> Or should we keep it on hold for review by lwIP developers.
>
> Looking forward to some response
>
> Regards
> Amit Ashara
>
> ___
> 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] Switching to dual stack LwIP

2016-10-19 Thread Dirk Ziegelmeier
there are no plans at the momet. Please file a task for it.


Ciao
Dirk

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

On Wed, Oct 19, 2016 at 5:17 AM, Aditya Prakash <aditya.prakash...@gmail.com
> wrote:

> Hi Dirk,
>
> > I guess dual-stack is not well tested with socket API :-( I did most of
> the dual-stack stuff, but since I don't use IPv6 and socket API at work, I
> have no real-life tests for it.
>
> Are there any plans to make this work, Or can this be added as a task to
> make socket API work with dual stack?
>
>
> On Mon, Oct 17, 2016 at 4:12 PM, Aditya Prakash <
> aditya.prakash...@gmail.com> wrote:
>
>> Hi,
>>
>> I am able to implement a web server using dual stack. However, I have an
>> MDNS implementation using two UDP sockets, for v4 and v6. My specification
>> requires me to join and send messages to v4 as well as v6. However, when I
>> try doing a `sendto` to the IPv4 group (inet_addr("224.0.0.251") ), using a
>> v6 socket, say fd is 'sock6',
>>
>> to.sin_family = AF_INET;
>> to.sin_port = port;
>> to.sin_addr.s_addr = inet_addr("224.0.0.251");
>>
>> len = sendto(sock6, (char *)m->header, size, 0, (struct sockaddr
>> *), sizeof(struct sockaddr_in));
>>
>> the following check fails
>>
>> ' if ((to != NULL) && !SOCK_ADDR_TYPE_MATCH(to, sock))'
>>
>> also if I try to append ::: in the beginning of the address(changing
>> family accordingly), the joingroup call fails.
>>
>> As of now I use the same above sockaddr_in `to`  to join v4 group via
>> setsockopt ADD_MEMBERSHIP. I wanted to know if it is possible to implement
>> the mdns without using the low level calls as in the lwip's example
>> mdns(i.e. using socket apis).
>>
>>
>> On Thu, Oct 6, 2016 at 6:03 PM, Aditya Prakash <
>> aditya.prakash...@gmail.com> wrote:
>>
>>>
>>> Hi,
>>>
>>> Two years back I made a web server based on LwIP that uses two sockets,
>>> one for IPv4 and one for IPv6.
>>>
>>> However recently I have seen that there have been a quite a lot of
>>> changes regarding dual stack, I am not sure to what extent it is
>>> implemented. I was wondering whether these changes would allow me to get to
>>> use a single socket for both IPv4 and IPv6.
>>>
>>> -
>>> Thanks & Regards,
>>> Aditya Prakash
>>>
>>
>>
>>
>> --
>> -
>> Thanks & Regards,
>> Aditya Prakash
>>
>
>
>
> --
> -
> Thanks & Regards,
> Aditya Prakash
>
> ___
> 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] Switching to dual stack LwIP

2016-10-18 Thread Dirk Ziegelmeier
I guess dual-stack is not well tested with socket API :-( I did most of the
dual-stack stuff, but since I don't use IPv6 and socket API at work, I have
no real-life tests for it.

Dirk


On Mon, Oct 17, 2016 at 12:42 PM, Aditya Prakash <
aditya.prakash...@gmail.com> wrote:

> Hi,
>
> I am able to implement a web server using dual stack. However, I have an
> MDNS implementation using two UDP sockets, for v4 and v6. My specification
> requires me to join and send messages to v4 as well as v6. However, when I
> try doing a `sendto` to the IPv4 group (inet_addr("224.0.0.251") ), using a
> v6 socket, say fd is 'sock6',
>
> to.sin_family = AF_INET;
> to.sin_port = port;
> to.sin_addr.s_addr = inet_addr("224.0.0.251");
>
> len = sendto(sock6, (char *)m->header, size, 0, (struct sockaddr
> *), sizeof(struct sockaddr_in));
>
> the following check fails
>
> ' if ((to != NULL) && !SOCK_ADDR_TYPE_MATCH(to, sock))'
>
> also if I try to append ::: in the beginning of the address(changing
> family accordingly), the joingroup call fails.
>
> As of now I use the same above sockaddr_in `to`  to join v4 group via
> setsockopt ADD_MEMBERSHIP. I wanted to know if it is possible to implement
> the mdns without using the low level calls as in the lwip's example
> mdns(i.e. using socket apis).
>
>
> On Thu, Oct 6, 2016 at 6:03 PM, Aditya Prakash <
> aditya.prakash...@gmail.com> wrote:
>
>>
>> Hi,
>>
>> Two years back I made a web server based on LwIP that uses two sockets,
>> one for IPv4 and one for IPv6.
>>
>> However recently I have seen that there have been a quite a lot of
>> changes regarding dual stack, I am not sure to what extent it is
>> implemented. I was wondering whether these changes would allow me to get to
>> use a single socket for both IPv4 and IPv6.
>>
>> -
>> Thanks & Regards,
>> Aditya Prakash
>>
>
>
>
> --
> -
> Thanks & Regards,
> Aditya Prakash
>
> ___
> 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

  1   2   >