<div dir="ltr">Thank you for the clarification. <br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 8 Jul 2019 at 01:04, Murphy McCauley <<a href="mailto:murphy.mccauley@gmail.com">murphy.mccauley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>The constructor arguments are basically the same for all classes in the packet library.</div><div><br></div>raw is used if you are parsing a raw packet that's held in a bytes/str object.<div>prev is mostly used internally to build chains of packet headers.  That is, since most packet headers are preceded by other packet headers, a packet's .prev usually points to the preceding one.  But most of the time you don't manually set it in the constructor; usually the right thing happens without you having to worry about it.</div><div><br></div><div>If you're constructing a packet from scratch, you use keyword arguments.  This isn't that useful for LLDP packets.  It's more useful for things like TCP packets.  It's more or less a shortcut so that you can do things like:</div><div>mypacket = foo(bar = 42)</div><div><br></div><div>Instead of:</div><div>mypacket = foo()</div><div>foo.bar = 42</div><div><br></div><div>LLDP packets don't really have many fields, though.  They're basically just a list of TLVs.  So the more common way to use it is just to create an empty LLDP header and append TLVs.  discovery does this, for example: <a href="https://github.com/noxrepo/pox/blob/eel/pox/openflow/discovery.py#L189" target="_blank">https://github.com/noxrepo/pox/blob/eel/pox/openflow/discovery.py#L189</a></div><div><br></div><div>-- Murphy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 7, 2019 at 6:01 AM AASIF MNIT <<a href="mailto:aasifmnit@gmail.com" target="_blank">aasifmnit@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>The following is code from lldp.py, I am unable to get use of parameters used in methods, please help me.</div><div><br></div><div><br></div>def __init__ (self, raw=None, prev=None, **kw):<br>    packet_base.__init__(self)<br><br>    self.prev = prev<br><br>    self.next = None<br>    self.tlvs = []<br><br>    if raw is not None:<br>      self.parse(raw)<br><br>    self._init(kw)<br></div>
</blockquote></div>
</blockquote></div>