Bridget
Please reply to the list, that way if i am not available, someone else on
the list can help you.

<I want to extract the first 4 bits of an ip packet ($packet).  Does the
following line of code do this for me?  Or does it give me the first four
bytes of the packet or even something else?   

$bytes = unpack("b4", $packet);
>

Couple of questions:
You want to extract the 4 bits into an array or into an string? 
Is this a raw packet dump in hex? 

There are many ways but here is one:
$packet = "234BBFF56";
@array = split(//, unpack('B4', $packet));
# @bits now has members 0,0,1,1 

---





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to