parsing ip packets

a kg9020@REDACTED
Wed May 3 19:13:39 CEST 2006


Thanks is there document or tutorial how I would apply this to a  
program .... I am going over lisp tutorial to get a better grasp of  
working with lists
Is this a list description... following  will following getting  
started and the REPOS tutorial bring up to speed to apply the code .....


thanks

Arthur Ingram


On May 3, 2006, at 11:47 AM, Javier París wrote:

> 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.




More information about the erlang-questions mailing list