title: How to add bits to the application layer when building a packet with scapy?
body: <p>I'm building a packet using scapy library and I want to add a certain bit string in the application layer, for example, 00110011. Unfortunately, scapy converts the string '00110011' to ASCII format. But what if I want to add these 8 bits only?</p>
  
  <p>Here's the packet I try to generate</p>
  
  <pre><code>pkt =  Ether(src='00:00:00:00:00:01', dst='ff:ff:ff:ff:ff:ff') /
  IP(src='10.10.10.10', dst='20.20.20.20', proto=0x8F) / 
  UDP(dport=4321, sport=1234) / '0b1111111'
  </code></pre>
  
  <p>Unfortunately, hexdump(pkt) gives me this: </p>
  
  <pre><code>0000   FF FF FF FF FF FF 00 00  00 00 00 01 08 00 45 00   ..............E.
  0010   00 25 00 01 00 00 40 8F  3E 0E 0A 0A 0A 0A 14 14   .%....@.&gt;.......
  0020   14 14 04 D2 10 E1 00 11  B8 69 30 62 31 31 31 31   .........i0b1111
  0030   31 31 31                                           111
  </code></pre>
  
  <p>But I want FF at the end, just that.</p>