package tcpip
OCaml TCP/IP networking stack, used in MirageOS
Install
Dune Dependency
Authors
Maintainers
Sources
tcpip-v6.4.0.tbz
sha256=6e32bf540d291e9b7325cb3dd00df2f695533e009c46ea534d5518b9492c7348
sha512=2e9f9ca2eeac637599eb48e087b4632598539f1c76f9251758995c7eedeb723f8b951d557a2a53b85a58d50a04e68e15598581f88fca8997733e800fcfca422b
doc/src/tcpip.tcp/tcp_wire.ml.html
Source file tcp_wire.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
[%%cstruct type tcp = { src_port: uint16_t; dst_port: uint16_t; sequence: uint32_t; ack_number: uint32_t; dataoff: uint8_t; flags: uint8_t; window: uint16_t; checksum: uint16_t; urg_ptr: uint16_t; } [@@big_endian] ] [%%cstruct type tcpv4_pseudo_header = { src: uint32_t; dst: uint32_t; res: uint8_t; proto: uint8_t; len: uint16_t; } [@@big_endian] ] (* XXX note that we overwrite the lower half of dataoff * with 0, so be careful when implemented CWE flag which * sits there *) let get_data_offset buf = ((get_tcp_dataoff buf) lsr 4) * 4 let set_data_offset buf v = set_tcp_dataoff buf (v lsl 4) let get_fin buf = ((Cstruct.get_uint8 buf 13) land (1 lsl 0)) > 0 let get_syn buf = ((Cstruct.get_uint8 buf 13) land (1 lsl 1)) > 0 let get_rst buf = ((Cstruct.get_uint8 buf 13) land (1 lsl 2)) > 0 let get_psh buf = ((Cstruct.get_uint8 buf 13) land (1 lsl 3)) > 0 let get_ack buf = ((Cstruct.get_uint8 buf 13) land (1 lsl 4)) > 0 let get_urg buf = ((Cstruct.get_uint8 buf 13) land (1 lsl 5)) > 0 let get_ece buf = ((Cstruct.get_uint8 buf 13) land (1 lsl 6)) > 0 let get_cwr buf = ((Cstruct.get_uint8 buf 13) land (1 lsl 7)) > 0 let set_fin buf = Cstruct.set_uint8 buf 13 ((Cstruct.get_uint8 buf 13) lor (1 lsl 0)) let set_syn buf = Cstruct.set_uint8 buf 13 ((Cstruct.get_uint8 buf 13) lor (1 lsl 1)) let set_rst buf = Cstruct.set_uint8 buf 13 ((Cstruct.get_uint8 buf 13) lor (1 lsl 2)) let set_psh buf = Cstruct.set_uint8 buf 13 ((Cstruct.get_uint8 buf 13) lor (1 lsl 3)) let set_ack buf = Cstruct.set_uint8 buf 13 ((Cstruct.get_uint8 buf 13) lor (1 lsl 4)) let set_urg buf = Cstruct.set_uint8 buf 13 ((Cstruct.get_uint8 buf 13) lor (1 lsl 5)) let set_ece buf = Cstruct.set_uint8 buf 13 ((Cstruct.get_uint8 buf 13) lor (1 lsl 6)) let set_cwr buf = Cstruct.set_uint8 buf 13 ((Cstruct.get_uint8 buf 13) lor (1 lsl 7))
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>