Skip to content

Commit bbc5b01

Browse files
authored
Merge pull request #529 from patricoferris/restore-packet-functions
Readd ipv4 get_tos and set_tos
2 parents ee22b76 + 27c4ba5 commit bbc5b01

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/ipv4/ipv4_wire.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
let sizeof_ipv4 = 20
22

33
let hlen_version_off = 0
4-
let _tos_off = 1
4+
let tos_off = 1
55
let len_off = 2
66
let id_off = 4
77
let off_off = 6
@@ -14,6 +14,9 @@ let dst_off = 16
1414
let get_hlen_version buf = Cstruct.get_uint8 buf hlen_version_off
1515
let set_hlen_version buf v = Cstruct.set_uint8 buf hlen_version_off v
1616

17+
let get_tos buf = Cstruct.get_uint8 buf tos_off
18+
let set_tos buf v = Cstruct.set_uint8 buf tos_off v
19+
1720
let get_len buf = Cstruct.BE.get_uint16 buf len_off
1821
let set_len buf v = Cstruct.BE.set_uint16 buf len_off v
1922

src/ipv4/ipv4_wire.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ val sizeof_ipv4 : int
33
val get_hlen_version : Cstruct.t -> int
44
val set_hlen_version : Cstruct.t -> int -> unit
55

6+
val get_tos : Cstruct.t -> int
7+
val set_tos : Cstruct.t -> int -> unit
8+
69
val get_len : Cstruct.t -> int
710
val set_len : Cstruct.t -> int -> unit
811

0 commit comments

Comments
 (0)