Re: [lwip-users] LLDP Implementation for lwIP

2016-08-03 Thread goldsi...@gmx.de

Amit Ashara wrote:

I would like to develop the Link Layer LLDP stack within lwIP framework.


Cool!


However the developer's manual link is empty.


I have absolutely *no* idea what this means.


Any suggestions where to start?


Implementing LLDP is a bit tricky if you have more than one port, as 
lwIP sees this as one 'netif' having a single IP address only (but the 
ports have a MAC address each, used for LLDP at least).


That being said, you'll have to send and receive LLDP packets on every 
Ethernet port. If you have only one port, send via "netif->linkoutput" 
and intercept before calling "ethernet_input()". If you have more than 
one port, it gets more tricky and doesn't really fit the lwIP netif 
concept:-(


Then, grab lwIP 2.0.0 (RC2 is the current one) and use the MIB-compiler 
from "contrib/apps/LwipMibCompiler" to implement the LLDP mib(s?) and 
feed the results of rx parsing into that mib.


I'd be interested in taking a look at the code once it's done!


Simon

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


Re: [lwip-users] LLDP Implementation for lwIP

2016-08-03 Thread Sergio R. Caprile

For a TCP/IP application:
the wiki http://lwip.wikia.com/wiki/LwIP_Wiki
the example applications in the contrib tree
the apps in the new tree (2.0.0RC2 and git head)

However, afaik (and I don't really know much), LLDP runs over bare 
Ethernet with ethertype=0x88CC, so you need to trap the frames from your 
driver before actually delivering them to lwIP. I think what you are 
probably looking for is this:

http://lwip.wikia.com/wiki/LwIP_with_or_without_an_operating_system
It explains how the driver interacts with lwIP to deliver the frames.

Take a look at the ethernetif code at /src/netif/ethernetif.c, the 
ethernetif_input() function:


  switch (htons(ethhdr->type)) {
  /* IP or ARP packet? */
  case ETHTYPE_IP:
  case ETHTYPE_ARP:
#if PPPOE_SUPPORT
  /* PPPoE packet? */
  case ETHTYPE_PPPOEDISC:
  case ETHTYPE_PPPOE:
#endif /* PPPOE_SUPPORT */
/* full packet send to tcpip_thread to process */
if (netif->input(p, netif)!=ERR_OK)
 { LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
   pbuf_free(p);
   p = NULL;
 }
break;

That is a skeleton, you need to implement something like that in your 
driver (Or the one who wrote it did something like that).


HOWEVER, this is so in 1.4.1. This has changed in git head, for some 
reason (I think PPPoE and layer-2 flexibility) this has been delegated 
to the lower level input function:


/* pass all packets to ethernet_input, which decides what packets 
it supports */

if (netif->input(p, netif) != ERR_OK) {

So basically your job is a layer-2 job; you have to work on your 
Ethernet driver. I suggest you go the git head or 2.0.0RC2 way, there 
have been numerous patches over 1.4.1



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


Re: [lwip-users] LLDP Implementation for lwIP

2016-08-03 Thread Amit Ashara
Hello Simon

I was referring to the following link

http://lwip.wikia.com/wiki/LwIP_Developers_Manual

This implementation is only for a single port device, which connects to a
switch/router. While the receive part is clear, it is the transmit path
that is not clear.

In the current implementation netif->linkoutput is already mapped to a
function which calls the EMAC driver. I checked the call stack and the
transmit call comes from the DHCP during IP address acquisition. So it is
not clear where do I insert the LLDP frame?

Regards
Amit


On Wed, Aug 3, 2016 at 2:07 PM, goldsi...@gmx.de  wrote:

> Amit Ashara wrote:
>
>> I would like to develop the Link Layer LLDP stack within lwIP framework.
>>
>
> Cool!
>
> However the developer's manual link is empty.
>>
>
> I have absolutely *no* idea what this means.
>
> Any suggestions where to start?
>>
>
> Implementing LLDP is a bit tricky if you have more than one port, as lwIP
> sees this as one 'netif' having a single IP address only (but the ports
> have a MAC address each, used for LLDP at least).
>
> That being said, you'll have to send and receive LLDP packets on every
> Ethernet port. If you have only one port, send via "netif->linkoutput" and
> intercept before calling "ethernet_input()". If you have more than one
> port, it gets more tricky and doesn't really fit the lwIP netif concept:-(
>
> Then, grab lwIP 2.0.0 (RC2 is the current one) and use the MIB-compiler
> from "contrib/apps/LwipMibCompiler" to implement the LLDP mib(s?) and feed
> the results of rx parsing into that mib.
>
> I'd be interested in taking a look at the code once it's done!
>
>
> 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] LLDP Implementation for lwIP

2016-08-03 Thread Amit Ashara
Hello Sergio,

As I mentioned earlier, the receive part is not the problem (based on the
inputs from Simon and going through the lwIP files. It is the transmit path
for which the call stack is not clear. Tracing it seems to always bring me
to the DHCP or TCP call function.

Regards
Amit

On Wed, Aug 3, 2016 at 2:46 PM, Amit Ashara  wrote:

> Hello Simon
>
> I was referring to the following link
>
> http://lwip.wikia.com/wiki/LwIP_Developers_Manual
>
> This implementation is only for a single port device, which connects to a
> switch/router. While the receive part is clear, it is the transmit path
> that is not clear.
>
> In the current implementation netif->linkoutput is already mapped to a
> function which calls the EMAC driver. I checked the call stack and the
> transmit call comes from the DHCP during IP address acquisition. So it is
> not clear where do I insert the LLDP frame?
>
> Regards
> Amit
>
>
> On Wed, Aug 3, 2016 at 2:07 PM, goldsi...@gmx.de  wrote:
>
>> Amit Ashara wrote:
>>
>>> I would like to develop the Link Layer LLDP stack within lwIP framework.
>>>
>>
>> Cool!
>>
>> However the developer's manual link is empty.
>>>
>>
>> I have absolutely *no* idea what this means.
>>
>> Any suggestions where to start?
>>>
>>
>> Implementing LLDP is a bit tricky if you have more than one port, as lwIP
>> sees this as one 'netif' having a single IP address only (but the ports
>> have a MAC address each, used for LLDP at least).
>>
>> That being said, you'll have to send and receive LLDP packets on every
>> Ethernet port. If you have only one port, send via "netif->linkoutput" and
>> intercept before calling "ethernet_input()". If you have more than one
>> port, it gets more tricky and doesn't really fit the lwIP netif concept:-(
>>
>> Then, grab lwIP 2.0.0 (RC2 is the current one) and use the MIB-compiler
>> from "contrib/apps/LwipMibCompiler" to implement the LLDP mib(s?) and feed
>> the results of rx parsing into that mib.
>>
>> I'd be interested in taking a look at the code once it's done!
>>
>>
>> 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] LLDP Implementation for lwIP

2016-08-03 Thread Sergio R. Caprile
I sent my response before you answered to Simon, so I couldn't know your 
problem was in the output path without violating causality. I think some 
states penalize that... ;^)


When the stack needs to send a frame, it will call netif->output. That 
pointer is usually setup at the init function for the netif driver (see 
ethernetif_init()). My driver sets up etharp_output() for that, and I 
followed the guidelines in the wiki link I sent you, I suggest you 
follow that. I'm using bare metal, not an OS, and I don't remember if 
there is a constraint for this (it is for input stage).


Anyway, that will eventually call netif->linkoutput() which is what you 
probably want to use. Remember you are using bare Ethernet over your 
driver in your port; you are not (yet) using lwIP.



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


Re: [lwip-users] LLDP Implementation for lwIP

2016-08-03 Thread goldsi...@gmx.de

Amit Ashara wrote:

http://lwip.wikia.com/wiki/LwIP_Developers_Manual


Oh, right. You see, I don't really follow the wiki... Wikia has way too 
much advertising.



This implementation is only for a single port device [..]
So it is not clear where do I insert the LLDP frame?


That's what I said. A device having one netif (i.e. the device's MAC 
address having one IP address) that connects to a network via multiple 
ports (which, in the LLDP case, each must have their own port MAC 
address), doesn't fit the lwIP netif model.


You need to insert the LLDP TX frames to your driver independent of lwIP 
(although it could be done by adding some kind of destination port to a 
pbuf or something like that). And you'll have to extract the source port 
from incoming pbufs, which is also not covered by lwIP.


I'm open for suggestions on integrating multi-port support to lwIP as 
long as it doesn't have negative side-effects on the standard 
single-port case.



Simon

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


Re: [lwip-users] LLDP Implementation for lwIP

2016-08-03 Thread Amit Ashara
Hello Simon,

LLDP can use the same MAC address as being used by lwIP. It is not mandated
that they be different.

Regards
Amit

On Wed, Aug 3, 2016 at 3:08 PM, goldsi...@gmx.de  wrote:

> Amit Ashara wrote:
>
>> http://lwip.wikia.com/wiki/LwIP_Developers_Manual
>>
>
> Oh, right. You see, I don't really follow the wiki... Wikia has way too
> much advertising.
>
> This implementation is only for a single port device [..]
>> So it is not clear where do I insert the LLDP frame?
>>
>
> That's what I said. A device having one netif (i.e. the device's MAC
> address having one IP address) that connects to a network via multiple
> ports (which, in the LLDP case, each must have their own port MAC address),
> doesn't fit the lwIP netif model.
>
> You need to insert the LLDP TX frames to your driver independent of lwIP
> (although it could be done by adding some kind of destination port to a
> pbuf or something like that). And you'll have to extract the source port
> from incoming pbufs, which is also not covered by lwIP.
>
> I'm open for suggestions on integrating multi-port support to lwIP as long
> as it doesn't have negative side-effects on the standard single-port case.
>
>
>
> 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] LLDP Implementation for lwIP

2016-08-03 Thread Amit Ashara
Hello Sergio,

I am using bare metal as well without OS and lwIP 1.4.1. So I don't see
most of the functions being mentioned. Looks like I would need to bring
2.0.0.RC2 (quite some work). in my case I am using the drivers from TM4C. I
checked and

  psNetif->output = etharp_output;

So what you are suggesting that I modify the etharp_output to process the
LLDP transmit packet?

Regards
Amit

On Wed, Aug 3, 2016 at 3:18 PM, Sergio R. Caprile 
wrote:

> I sent my response before you answered to Simon, so I couldn't know your
> problem was in the output path without violating causality. I think some
> states penalize that... ;^)
>
> When the stack needs to send a frame, it will call netif->output. That
> pointer is usually setup at the init function for the netif driver (see
> ethernetif_init()). My driver sets up etharp_output() for that, and I
> followed the guidelines in the wiki link I sent you, I suggest you follow
> that. I'm using bare metal, not an OS, and I don't remember if there is a
> constraint for this (it is for input stage).
>
> Anyway, that will eventually call netif->linkoutput() which is what you
> probably want to use. Remember you are using bare Ethernet over your driver
> in your port; you are not (yet) using lwIP.
>
>
>
> ___
> 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 lwIP

2016-08-03 Thread Sergio R. Caprile
> Oh, right. You see, I don't really follow the wiki... Wikia has way 
too much advertising.


AdBlock Plus rules!



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


Re: [lwip-users] LLDP Implementation for lwIP

2016-08-03 Thread Sergio R. Caprile

I'm also using 1.4.1, maybe the driver obscures some stuff.

ethernetif_init()). My driver sets up etharp_output() for that, and I

[...]

Anyway, that will eventually call netif->linkoutput() which is what you
probably want to use.


The driver should have a netif structure somewhere, with that function 
pointer. That should be passed to the init function at the setup phase, 
when calling netif_add(), which calls the init function inside the 
driver and passes the netif structure. I just powered off my main 
machine and can't access my driver to double check (without spending 
extra time I don't have right now), but I'm sure I can't be too far.
Read the wiki link I've sent and follow that, 1.4.1 is fine for this, 
you can upgrade later if you want (suggested, but I haven't yet)



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


Re: [lwip-users] LLDP Implementation for lwIP

2016-08-03 Thread Amit Ashara
Hello Sergio,

Yes, I went through the link

http://lwip.wikia.com/wiki/LwIP_with_or_without_an_operating_system

The netif_add calls the function tivaif_init from the porting file. Inside
the function tivaif_init the function call is as follows

  psNetif->output = etharp_output;
  psNetif->linkoutput = tivaif_transmit;

If i check the tivaif_transmit function, "tivaif_transmit(struct netif
*psNetif, struct pbuf *p)" it maps the pbuf to the MAC controller for
transmission. It is this buffer that needs to be modified for LLDP frame.
However the call stack is always from TCP or DHCP (even when ARP is called
which is a link layer packet).

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

Re: [lwip-users] LLDP Implementation for lwIP

2016-08-04 Thread Sergio R. Caprile
>  psNetif->linkoutput = tivaif_transmit;

> If i check the tivaif_transmit function, "tivaif_transmit(struct
> netif *psNetif, struct pbuf *p)" it maps the pbuf to the MAC
> controller for transmission. It is this buffer that needs to be
> modified for LLDP frame.

Not exactly. You need to allocate a pbuf, fill it with your data, give
it to tivaif_transmit(), and free it when it is done. Unless there is
some retransmission mechanism inside LLDP (which I don't know), then it
is done when the controller has it in its memory. Unless it is a
zero-copy driver (looks so, DMA perhaps?), in which "the controller
memory and the pbuf memory is the same space", so you need to know when
it has been transmitted to free it. I have no expertise in this area,
but there is this:
http://lwip.wikia.com/wiki/Writing_a_device_driver#Notes_on_Zero-Copy_Network_interface_drivers

> However the call stack is always from TCP or DHCP (even when ARP is
> called which is a link layer packet).

That is because you said you just needed the output phase ;^)
The stack is answering because it is receiving the datagrams.
Now you need to check your input to see why. You can go two paths, and I
suggest you take both, not necessarily in this order.

(1) Go back to my first mail, where I've shown you code that explains this

(2) Read this:
http://lwip.wikia.com/wiki/Writing_a_device_driver

ARP is link layer but is part of the IP suite, so the stack supports ARP
and the link level driver has been configured to deliver ARP to lwIP
input function.



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


Re: [lwip-users] LLDP Implementation for lwIP

2016-08-04 Thread Amit Ashara
Hello Sergio

LLDP is a multicast information only packet. It has the be sent at fixed time 
intervals. The second approach to have a separate driver and calling it in a 
timer function seems to be the approach. Again the receive packet is easy to 
process. The transmit needs to be thought and inserted . Let me run some 
experiments and run into issues rather than sending emails on phantom issues.

Regards
Amit Ashara

On Aug 4, 2016, at 9:31 AM, Sergio R. Caprile  wrote:

>> psNetif->linkoutput = tivaif_transmit;
> 
>> If i check the tivaif_transmit function, "tivaif_transmit(struct
>> netif *psNetif, struct pbuf *p)" it maps the pbuf to the MAC
>> controller for transmission. It is this buffer that needs to be
>> modified for LLDP frame.
> 
> Not exactly. You need to allocate a pbuf, fill it with your data, give
> it to tivaif_transmit(), and free it when it is done. Unless there is
> some retransmission mechanism inside LLDP (which I don't know), then it
> is done when the controller has it in its memory. Unless it is a
> zero-copy driver (looks so, DMA perhaps?), in which "the controller
> memory and the pbuf memory is the same space", so you need to know when
> it has been transmitted to free it. I have no expertise in this area,
> but there is this:
> http://lwip.wikia.com/wiki/Writing_a_device_driver#Notes_on_Zero-Copy_Network_interface_drivers
> 
>> However the call stack is always from TCP or DHCP (even when ARP is
>> called which is a link layer packet).
> 
> That is because you said you just needed the output phase ;^)
> The stack is answering because it is receiving the datagrams.
> Now you need to check your input to see why. You can go two paths, and I
> suggest you take both, not necessarily in this order.
> 
> (1) Go back to my first mail, where I've shown you code that explains this
> 
> (2) Read this:
>http://lwip.wikia.com/wiki/Writing_a_device_driver
> 
> ARP is link layer but is part of the IP suite, so the stack supports ARP
> and the link level driver has been configured to deliver ARP to lwIP
> input function.
> 
> 
> 
> ___
> 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 lwIP

2016-08-12 Thread Amit Ashara
Hello Sergio, Simon,

I finally got the LLDP basic frame to work. I am able to send the LLDP
frame out of my device and see the same correctly on the wire-shark.

However, do be able to make a proper source code out of it, I would need
advise. The fields of the LLDP are static and not expected to change
dynamically. Also it is up to the user to decide what is required in the
fields and some of the field size may be configured at compile time. How do
I do this within the framework of lwIP

As an example, following is the "hack-patch" code.

#if !LWIP_AUTOIP
static
#endif /* LWIP_AUTOIP */
err_t
lldp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr)
{
#if 1
  struct pbuf *p;
  err_t result = ERR_OK;
  struct eth_hdr *ethhdr;
  struct lldp_hdr *lldptlv;

  LWIP_ASSERT("netif != NULL", netif != NULL);

  /* allocate a pbuf for the outgoing ARP request packet */
  p = pbuf_alloc(PBUF_RAW, SIZEOF_LLDP_PACKET, PBUF_RAM);
  /* could allocate a pbuf for an ARP request? */
  if (p == NULL) {
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS,
  ("etharp_raw: could not allocate pbuf for ARP request.\n"));
ETHARP_STATS_INC(etharp.memerr);
return ERR_MEM;
  }
  LWIP_ASSERT("check that first pbuf can hold struct etharp_hdr",
  (p->len >= SIZEOF_LLDP_PACKET));

  ethhdr = (struct eth_hdr *)p->payload;
  lldptlv = (struct lldp_hdr *)((u8_t*)ethhdr + SIZEOF_ETH_HDR);
  LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_raw: sending raw
ARP packet.\n"));

  lldptlv->chassisid.tlvtype= 0x02;
  lldptlv->chassisid.tlvlen = 0x07;
  lldptlv->chassisid.tlvsubtype = 0x04;
  ETHADDR16_COPY(&lldptlv->chassisid.tlvvalue,ethsrc_addr);

  lldptlv->portid.tlvtype  = 0x04;
  lldptlv->portid.tlvlen   = 0x07;
  lldptlv->portid.tlvsubtype = 0x03;
  ETHADDR16_COPY(&lldptlv->portid.tlvvalue,ethsrc_addr);

  lldptlv->ttl.tlvtype  = 0x06;
  lldptlv->ttl.tlvlen   = 0x07;
  lldptlv->ttl.tlvsubtype = 0x00;
  lldptlv->ttl.tlvvalue[0] = 0x10;
  lldptlv->ttl.tlvvalue[1] = 0x00;
  lldptlv->ttl.tlvvalue[2] = 0x00;
  lldptlv->ttl.tlvvalue[3] = 0x00;
  lldptlv->ttl.tlvvalue[4] = 0x00;
  lldptlv->ttl.tlvvalue[5] = 0x00;


  LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN
for etharp!",
  (netif->hwaddr_len == ETHARP_HWADDR_LEN));
  /* Write the Ethernet MAC-Addresses */
  ETHADDR16_COPY(ðhdr->dest, ðlldpdestmac0);
  ETHADDR16_COPY(ðhdr->src, ethsrc_addr);
  ethhdr->type = PP_HTONS(ETHTYPE_LLDP);

  /* send ARP query */
  result = netif->linkoutput(netif, p);
  //ETHARP_STATS_INC(etharp.xmit);
  /* free ARP query packet */
  pbuf_free(p);
  p = NULL;
  /* could not allocate pbuf for ARP request */

  return result;
#endif
}


Regards
Amit

On Thu, Aug 4, 2016 at 1:07 PM, Amit Ashara  wrote:

> Hello Sergio
>
> LLDP is a multicast information only packet. It has the be sent at fixed
> time intervals. The second approach to have a separate driver and calling
> it in a timer function seems to be the approach. Again the receive packet
> is easy to process. The transmit needs to be thought and inserted . Let me
> run some experiments and run into issues rather than sending emails on
> phantom issues.
>
> Regards
> Amit Ashara
>
> On Aug 4, 2016, at 9:31 AM, Sergio R. Caprile  wrote:
>
> >> psNetif->linkoutput = tivaif_transmit;
> >
> >> If i check the tivaif_transmit function, "tivaif_transmit(struct
> >> netif *psNetif, struct pbuf *p)" it maps the pbuf to the MAC
> >> controller for transmission. It is this buffer that needs to be
> >> modified for LLDP frame.
> >
> > Not exactly. You need to allocate a pbuf, fill it with your data, give
> > it to tivaif_transmit(), and free it when it is done. Unless there is
> > some retransmission mechanism inside LLDP (which I don't know), then it
> > is done when the controller has it in its memory. Unless it is a
> > zero-copy driver (looks so, DMA perhaps?), in which "the controller
> > memory and the pbuf memory is the same space", so you need to know when
> > it has been transmitted to free it. I have no expertise in this area,
> > but there is this:
> > http://lwip.wikia.com/wiki/Writing_a_device_driver#Notes_
> on_Zero-Copy_Network_interface_drivers
> >
> >> However the call stack is always from TCP or DHCP (even when ARP is
> >> called which is a link layer packet).
> >
> > That is because you said you just needed the output phase ;^)
> > The stack is answering because it is receiving the datagrams.
> > Now you need to check your input to see why. You can go two paths, and I
> > suggest you take both, not necessarily in this order.
> >
> > (1) Go back to my first mail, where I've shown you code that explains
> this
> >
> > (2) Read this:
> >http://lwip.wikia.com/wiki/Writing_a_device_driver
> >
> > ARP is link layer but

Re: [lwip-users] LLDP Implementation for lwIP

2016-08-12 Thread goldsimon

Amit Ashara wrote:


LLDP can use the same MAC address as being used by lwIP. It is not mandated
that they be different.


No, but if you have more than one port, it's typical to have one MAC per 
port. This helps to tell which port of a switch a device is connected to, 
for example (e.g. used in profinet for simple device replacement).


For a single port device, the MAC address used for lldp can obviously be 
the same lwip uses.


I was just saying lwip does not very well support multi port devices.

Simon



Gesendet mit AquaMail für Android
http://www.aqua-mail.com
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] LLDP Implementation for lwIP

2016-08-12 Thread Amit Ashara
Hello Simon,

I call the LLDP transmit function lldp_raw(struct netif *netif, const
struct eth_addr *ethsrc_addr) with the MAC address of the port. So if there
are multiple ports each with its MAC address, then that can be resolved by
the 2nd argument of the function.

Also if we put the use restriction of a single port, wouldn't that work
also?

Regards,
Amit

On Fri, Aug 12, 2016 at 3:01 PM, goldsimon  wrote:

> Amit Ashara wrote:
>
> > LLDP can use the same MAC address as being used by lwIP. It is not
> mandated
> > that they be different.
>
> No, but if you have more than one port, it's typical to have one MAC per
> port. This helps to tell which port of a switch a device is connected to,
> for example (e.g. used in profinet for simple device replacement).
>
> For a single port device, the MAC address used for lldp can obviously be
> the same lwip uses.
>
> I was just saying lwip does not very well support multi port devices.
>
> Simon
>
> Gesendet mit AquaMail für Android
> http://www.aqua-mail.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] LLDP Implementation for lwIP

2016-08-15 Thread Amit Ashara
Hello Simon, Sergio,

Any further thoughts on the same?

Regards
Amit

On Fri, Aug 12, 2016 at 3:20 PM, Amit Ashara  wrote:

> Hello Simon,
>
> I call the LLDP transmit function lldp_raw(struct netif *netif, const
> struct eth_addr *ethsrc_addr) with the MAC address of the port. So if there
> are multiple ports each with its MAC address, then that can be resolved by
> the 2nd argument of the function.
>
> Also if we put the use restriction of a single port, wouldn't that work
> also?
>
> Regards,
> Amit
>
> On Fri, Aug 12, 2016 at 3:01 PM, goldsimon  wrote:
>
>> Amit Ashara wrote:
>>
>> > LLDP can use the same MAC address as being used by lwIP. It is not
>> mandated
>> > that they be different.
>>
>> No, but if you have more than one port, it's typical to have one MAC per
>> port. This helps to tell which port of a switch a device is connected to,
>> for example (e.g. used in profinet for simple device replacement).
>>
>> For a single port device, the MAC address used for lldp can obviously be
>> the same lwip uses.
>>
>> I was just saying lwip does not very well support multi port devices.
>>
>> Simon
>>
>> Gesendet mit AquaMail für Android
>> http://www.aqua-mail.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] LLDP Implementation for lwIP

2016-08-17 Thread Sergio R. Caprile
I would #define fixed fields in the lldp.h equivalent and #ifndef 
#define the user modifiable values in a lldpopts.h file. However, I'm 
just as a user as you are; Simon is THE man here ;^)




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


Re: [lwip-users] LLDP Implementation for lwIP

2016-08-17 Thread Amit Ashara
Thanks Sergio. I am also awaiting Simon's inputs as well

Regards
Amit

On Wed, Aug 17, 2016 at 8:41 AM, Sergio R. Caprile 
wrote:

> I would #define fixed fields in the lldp.h equivalent and #ifndef #define
> the user modifiable values in a lldpopts.h file. However, I'm just as a
> user as you are; Simon is THE man here ;^)
>
>
>
>
> ___
> 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 lwIP

2016-08-17 Thread Simon Goldschmidt
Amit Ashara wrote:
> I call the LLDP transmit function lldp_raw(struct netif *netif, const struct 
> eth_addr *ethsrc_addr)
> with the MAC address of the port. So if there are multiple ports each with 
> its MAC address, then
> that can be resolved by the 2nd argument of the function.

That's not netif-portable. A netif driver has to implement 
netif_linkoutput_fn(struct netif *netif, struct pbuf *p)
and there's no source MAC address passed. You can check the pbuf of course, but 
that's not acceptable
for all TX packets.

> Also if we put the use restriction of a single port, wouldn't that work also?

You can do that but you would limit the use of such a protocol implementation.

Simon

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


Re: [lwip-users] LLDP Implementation for lwIP

2016-08-17 Thread Amit Ashara
Hello Simon

I can make the change for lldp_raw to be netif compliant and using internal
functions in the lldp.c to construct the packet.

Will it be OK in that case (along with the single port requirement)

Regards
Amit

On Wed, Aug 17, 2016 at 9:12 AM, Simon Goldschmidt  wrote:

> Amit Ashara wrote:
> > I call the LLDP transmit function lldp_raw(struct netif *netif, const
> struct eth_addr *ethsrc_addr)
> > with the MAC address of the port. So if there are multiple ports each
> with its MAC address, then
> > that can be resolved by the 2nd argument of the function.
>
> That's not netif-portable. A netif driver has to implement
> netif_linkoutput_fn(struct netif *netif, struct pbuf *p)
> and there's no source MAC address passed. You can check the pbuf of
> course, but that's not acceptable
> for all TX packets.
>
> > Also if we put the use restriction of a single port, wouldn't that work
> also?
>
> You can do that but you would limit the use of such a protocol
> implementation.
>
> 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] LLDP Implementation for lwIP

2016-08-17 Thread Amit Ashara
Hello Simon

I have reduced the function call as lldp_raw(struct netif *netif);

Since the packet needs to be constructed based on options, the functions
called by lldp_raw would be static. After constructing the packet lldp_raw
callsnetif->linkoutput(netif, p); The pbuf p is allocated in the function
lldp_raw.

Regards
Amit

On Wed, Aug 17, 2016 at 9:15 AM, Amit Ashara  wrote:

> Hello Simon
>
> I can make the change for lldp_raw to be netif compliant and using
> internal functions in the lldp.c to construct the packet.
>
> Will it be OK in that case (along with the single port requirement)
>
> Regards
> Amit
>
> On Wed, Aug 17, 2016 at 9:12 AM, Simon Goldschmidt 
> wrote:
>
>> Amit Ashara wrote:
>> > I call the LLDP transmit function lldp_raw(struct netif *netif, const
>> struct eth_addr *ethsrc_addr)
>> > with the MAC address of the port. So if there are multiple ports each
>> with its MAC address, then
>> > that can be resolved by the 2nd argument of the function.
>>
>> That's not netif-portable. A netif driver has to implement
>> netif_linkoutput_fn(struct netif *netif, struct pbuf *p)
>> and there's no source MAC address passed. You can check the pbuf of
>> course, but that's not acceptable
>> for all TX packets.
>>
>> > Also if we put the use restriction of a single port, wouldn't that work
>> also?
>>
>> You can do that but you would limit the use of such a protocol
>> implementation.
>>
>> 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] LLDP Implementation for lwIP

2016-08-18 Thread Amit Ashara
Hello All,

I have the updated files for lldp transmit function. How do I put it up for
review?

Regards
Amit

On Wed, Aug 17, 2016 at 9:38 AM, Amit Ashara  wrote:

> Hello Simon
>
> I have reduced the function call as lldp_raw(struct netif *netif);
>
> Since the packet needs to be constructed based on options, the functions
> called by lldp_raw would be static. After constructing the packet lldp_raw
> callsnetif->linkoutput(netif, p); The pbuf p is allocated in the function
> lldp_raw.
>
> Regards
> Amit
>
> On Wed, Aug 17, 2016 at 9:15 AM, Amit Ashara 
> wrote:
>
>> Hello Simon
>>
>> I can make the change for lldp_raw to be netif compliant and using
>> internal functions in the lldp.c to construct the packet.
>>
>> Will it be OK in that case (along with the single port requirement)
>>
>> Regards
>> Amit
>>
>> On Wed, Aug 17, 2016 at 9:12 AM, Simon Goldschmidt 
>> wrote:
>>
>>> Amit Ashara wrote:
>>> > I call the LLDP transmit function lldp_raw(struct netif *netif, const
>>> struct eth_addr *ethsrc_addr)
>>> > with the MAC address of the port. So if there are multiple ports each
>>> with its MAC address, then
>>> > that can be resolved by the 2nd argument of the function.
>>>
>>> That's not netif-portable. A netif driver has to implement
>>> netif_linkoutput_fn(struct netif *netif, struct pbuf *p)
>>> and there's no source MAC address passed. You can check the pbuf of
>>> course, but that's not acceptable
>>> for all TX packets.
>>>
>>> > Also if we put the use restriction of a single port, wouldn't that
>>> work also?
>>>
>>> You can do that but you would limit the use of such a protocol
>>> implementation.
>>>
>>> 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] LLDP Implementation for lwIP

2016-08-19 Thread Simon Goldschmidt
Amit Ashara wrote:
> I have the updated files for lldp transmit function. How do I put it up for 
> review?

What about setting up a repository somewhere 8e.g. github?) and posting a link 
here?

As i said at the beginning, I'd be interested to see an lldp implementation.
However, lwIP is an *IP* stack, so I'm not (yet?) convinced the lwIP git 
repository
is the right place for it.

That being said, I didn't get your descriptions about the code, so putting it 
somewhere
for review might really be the best idea to proceed.

Simon

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


Re: [lwip-users] LLDP Implementation for lwIP

2016-08-19 Thread Amit Ashara
Hello Simon

OK, I will set it up on git. I wanted to however check before I do that is
that is there a contributor license agreement/contributors agreement for
lwIP that I need to be aware of?

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

Re: [lwip-users] LLDP Implementation for lwIP

2016-08-19 Thread Simon Goldschmidt
Amit Ashara wrote:
> I wanted to however check before I do that is that is there a contributor 
> license
> agreement/contributors agreement for lwIP that I need to be aware of?

lwIP's license is available nearly everywhere (website, sources, etc.).

What I don't get is: where would the lwIP license be touched if you write an 
LLDP stack?


Simon

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


Re: [lwip-users] LLDP Implementation for lwIP

2016-08-19 Thread Amit Ashara
Hello Simon

The lwIP license would not be touched. The only change will be that the
lldp.c and lldp.h files may have copyright information w.r.t the
organization I work for (*and I am clarifying with the legal team).

Regards
Amit

On Fri, Aug 19, 2016 at 9:11 AM, Simon Goldschmidt  wrote:

> Amit Ashara wrote:
> > I wanted to however check before I do that is that is there a
> contributor license
> > agreement/contributors agreement for lwIP that I need to be aware of?
>
> lwIP's license is available nearly everywhere (website, sources, etc.).
>
> What I don't get is: where would the lwIP license be touched if you write
> an LLDP stack?
>
>
> 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] LLDP Implementation for lwIP

2016-08-19 Thread goldsimon

Hi Amit,

of course you must make up for a licence before sharing anything. 
Personally, I'm not sure I would contribute to anything not compatible to 
the lwip licence though.


Simon


Gesendet mit AquaMail für Android
http://www.aqua-mail.com


Am 19. August 2016 4:28:55 nachm. schrieb Amit Ashara :


Hello Simon

The lwIP license would not be touched. The only change will be that the
lldp.c and lldp.h files may have copyright information w.r.t the
organization I work for (*and I am clarifying with the legal team).

Regards
Amit

On Fri, Aug 19, 2016 at 9:11 AM, Simon Goldschmidt  wrote:


Amit Ashara wrote:
> I wanted to however check before I do that is that is there a
contributor license
> agreement/contributors agreement for lwIP that I need to be aware of?

lwIP's license is available nearly everywhere (website, sources, etc.).

What I don't get is: where would the lwIP license be touched if you write
an LLDP stack?


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 lwIP

2016-08-23 Thread Dirk Ziegelmeier
Hi Amit,

you can now use ethernet_output() in lwIP git head to send your packets.
There is also an LWIP_HOOK_UNKNOWN_ETH_PROTOCOL now to receive ethernet
protocols that are unknown to lwIP.

Dirk

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

On Fri, Aug 19, 2016 at 4:28 PM, Amit Ashara  wrote:

> Hello Simon
>
> The lwIP license would not be touched. The only change will be that the
> lldp.c and lldp.h files may have copyright information w.r.t the
> organization I work for (*and I am clarifying with the legal team).
>
> Regards
> Amit
>
> On Fri, Aug 19, 2016 at 9:11 AM, Simon Goldschmidt 
> wrote:
>
>> Amit Ashara wrote:
>> > I wanted to however check before I do that is that is there a
>> contributor license
>> > agreement/contributors agreement for lwIP that I need to be aware of?
>>
>> lwIP's license is available nearly everywhere (website, sources, etc.).
>>
>> What I don't get is: where would the lwIP license be touched if you write
>> an LLDP stack?
>>
>>
>> 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 lwIP

2016-08-23 Thread Amit Ashara
Hello Dirk

I am using 1.4.1 version of the lwIP. Maybe once I get all the copyright
and licensing in place, I can share the lldp files for review and latter
merge them with lwIP if everyone else agrees

Regards
Amit

On Tue, Aug 23, 2016 at 5:46 AM, Dirk Ziegelmeier 
wrote:

> Hi Amit,
>
> you can now use ethernet_output() in lwIP git head to send your packets.
> There is also an LWIP_HOOK_UNKNOWN_ETH_PROTOCOL now to receive ethernet
> protocols that are unknown to lwIP.
>
> Dirk
>
> --
> Dirk Ziegelmeier * d...@ziegelmeier.net * http://www.ziegelmeier.net
>
> On Fri, Aug 19, 2016 at 4:28 PM, Amit Ashara 
> wrote:
>
>> Hello Simon
>>
>> The lwIP license would not be touched. The only change will be that the
>> lldp.c and lldp.h files may have copyright information w.r.t the
>> organization I work for (*and I am clarifying with the legal team).
>>
>> Regards
>> Amit
>>
>> On Fri, Aug 19, 2016 at 9:11 AM, Simon Goldschmidt 
>> wrote:
>>
>>> Amit Ashara wrote:
>>> > I wanted to however check before I do that is that is there a
>>> contributor license
>>> > agreement/contributors agreement for lwIP that I need to be aware of?
>>>
>>> lwIP's license is available nearly everywhere (website, sources, etc.).
>>>
>>> What I don't get is: where would the lwIP license be touched if you
>>> write an LLDP stack?
>>>
>>>
>>> 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
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] LLDP Implementation for lwIP

2016-09-07 Thread Amit Ashara
Hello All,

How do I release the source code and the license file? I have never used
git earlier.

Regards
Amit

On Tue, Aug 23, 2016 at 7:01 AM, Amit Ashara  wrote:

> Hello Dirk
>
> I am using 1.4.1 version of the lwIP. Maybe once I get all the copyright
> and licensing in place, I can share the lldp files for review and latter
> merge them with lwIP if everyone else agrees
>
> Regards
> Amit
>
> On Tue, Aug 23, 2016 at 5:46 AM, Dirk Ziegelmeier 
> wrote:
>
>> Hi Amit,
>>
>> you can now use ethernet_output() in lwIP git head to send your packets.
>> There is also an LWIP_HOOK_UNKNOWN_ETH_PROTOCOL now to receive ethernet
>> protocols that are unknown to lwIP.
>>
>> Dirk
>>
>> --
>> Dirk Ziegelmeier * d...@ziegelmeier.net * http://www.ziegelmeier.net
>>
>> On Fri, Aug 19, 2016 at 4:28 PM, Amit Ashara 
>> wrote:
>>
>>> Hello Simon
>>>
>>> The lwIP license would not be touched. The only change will be that the
>>> lldp.c and lldp.h files may have copyright information w.r.t the
>>> organization I work for (*and I am clarifying with the legal team).
>>>
>>> Regards
>>> Amit
>>>
>>> On Fri, Aug 19, 2016 at 9:11 AM, Simon Goldschmidt 
>>> wrote:
>>>
 Amit Ashara wrote:
 > I wanted to however check before I do that is that is there a
 contributor license
 > agreement/contributors agreement for lwIP that I need to be aware of?

 lwIP's license is available nearly everywhere (website, sources, etc.).

 What I don't get is: where would the lwIP license be touched if you
 write an LLDP stack?


 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
>>
>
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users