Fwd: parsing ip packets//Newbie

a <>
Thu May 4 00:39:59 CEST 2006


Hello is there a good tutorial showing how to apply this code in an  
application  ...

Begin forwarded message:

> From: Javier París <>
> Date: May 3, 2006 11:47:11 AM CDT
> To: a <>
> Cc: 
> Subject: Re: parsing ip packets
> Reply-To: 
>
> El Miércoles, 3 de Mayo de 2006 18:10, a escribió:
>> Hello,
>>
>> I am new learning erlang ... are there examples of parsing a ip
>> packet to determine what time ?
>
> Parsing a (binary) ip packet would be something like..
>
> <<4:4/integer,          % Ip Version
>      Hd_Len:4/integer,      % Header Length
>      Tos:8/integer,           % Tos
>      Len:16/big-integer,    % Packet Length
>      Frg_Id:16/big-integer, % Fragment Id
>      _:2/integer,           % Two first flags... bah
>      Mf:1/integer,          % More Fragments flag
>      Offset:13/big-integer, % Fragment Offset
>      TTL:8/integer,           % TTL
>      Protocol:8/integer,    % Upper layer protocol
>      Checksum:16/big-integer,      % Checksum
>      Src_Ip:32/big-integer, % Where this pile of shit came from...
>      Dst_Ip:32/big-integer, % Should check this against our Ip
>      Options/binary>> = Ip_Header, % Options
>
> This would be for a rfc791 Ip packet. That is, it is a bit outdated.
> (For example, TOS isn't used anymore, and that field is used
> for explicit congestion notification, among other things).
>
> Regards.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20060503/ec156284/attachment.html>


More information about the erlang-questions mailing list