def ipv6_hdr_len(ipv6):
hdr_len = ipv6.__hdr_len__<EOL>for code in (<NUM_LIT:0>, <NUM_LIT>, <NUM_LIT>):<EOL><INDENT>ext_hdr = ipv6.extension_hdrs.get(code)<EOL>if ext_hdr is not None:<EOL><INDENT>hdr_len += ext_hdr.length<EOL><DEDENT><DEDENT>return hdr_len<EOL>
Calculate length of headers before IPv6-Frag