% NETBIOS regression tests for Scapy

# More information at http://www.secdev.org/projects/UTscapy/

############
############
+ Netbios tests

= NBNSQueryRequest - build

z = NBNSQueryRequest(SUFFIX="file server service", QUESTION_NAME='TEST1', QUESTION_TYPE='NB')

assert raw(z) == b'\x00\x00\x01\x10\x00\x01\x00\x00\x00\x00\x00\x00 FEEFFDFEDBCACACACACACACACACACACA\x00\x00 \x00\x01'

pkt = IP(dst='192.168.0.255')/UDP(sport=137, dport='netbios_ns')/z
pkt = IP(raw(pkt))
assert pkt.QUESTION_NAME == b'TEST1          '