old_contents: """
  This module containes pure functions to parse and craft packets.
  """
  
  from ryu.lib.packet import packet
  from ryu.lib.packet import ethernet
  from ryu.lib.packet import arp
  from ryu.lib.packet import lldp
  
  def create_lldp(dpid,port_no=DEFAULT_VALUE):
      '''
      Ryu.packet_lldp()
      '''
      pass
  
  def create_arp( dl_src,dl_dst,nl_src,nl_dst):
      '''
      => ARP()
      '''
      pass
  
  def parse_lldp(decr,data):
      '''
      => (descr dictionary is built and descr is returned)
      
      '''
      pass
  
  def parse_arp(descr,data):
      '''
      Same as parse_lldp
      '''
      pass
  
  def parse(data):
      '''
      {"dl_type:","dl_src":}
      eth.header=()
      if parse.arp()
      elif parse_lldp()
      call parse_arp()
      '''
      pass
  
new_contents: """
  This module containes pure functions to parse and craft packets.
  """
  
  from ryu.lib.packet import packet
  from ryu.lib.packet import ethernet
  from ryu.lib.packet import arp
  from ryu.lib.packet import lldp
  
  def create_lldp(dpid,port_no=DEFAULT_VALUE):
      '''
      Ryu.packet_lldp()
      '''
      pkt = packet.Packet()
      dst = ""
      ethertype = ether.ETH_TYPE_LLDP
      eth_pkt = ethernet.ethernet(dst, dpid, ethertype)
      pkt.add_protocol(eth_pkt)
      tlv_chassis_id = lldp.ChassisID(subtype=lldp.ChassisID.SUB_MAC_ADDRESS,
                                      chassis_id=haddr_to_bin(dpid))
  
      tlv_port_id = lldp.PortID(subtype=lldp.PortID.SUB_INTERFACE_NAME,
                                port_id=str(port_no))
      tlv_ttl = lldp.TTL(ttl=2)
      tlv_end = lldp.End()
      tlvs = (tlv_chassis_id, tlv_port_id, tlv_ttl, tlv_end)
      lldp_pkt = lldp.lldp(tlvs)
      lldp_pkt = lldp.lldp(tlvs)
      pkt.add_protocol(lldp_pkt)
      pkt.serialize()
      
      
  
  def create_arp( dl_src,dl_dst,nl_src,nl_dst):
      '''
      => ARP()
      '''
      pass
  
  def parse_lldp(decr,data):
      '''
      => (descr dictionary is built and descr is returned)
      
      '''
      pass
  
  def parse_arp(descr,data):
      '''
      Same as parse_lldp
      '''
      pass
  
  def parse(data):
      '''
      {"dl_type:","dl_src":}
      eth.header=()
      if parse.arp()
      elif parse_lldp()
      call parse_arp()
      '''
      pass
  
subject: Update packet.py