code: def ipv6_hdr_len(ipv6):
      
      hdr_len = ipv6.__hdr_len__
      for code in (0, 60, 43):
          ext_hdr = ipv6.extension_hdrs.get(code)
          if ext_hdr is not None:
              hdr_len += ext_hdr.length
      return hdr_len
docs: Calculate length of headers before IPv6-Frag