git.annexia.org
/
ocaml-bitstring.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Renaming bitmatch -> bitstring.
[ocaml-bitstring.git]
/
examples
/
ipv4_header.ml
diff --git
a/examples/ipv4_header.ml
b/examples/ipv4_header.ml
index
6db81ad
..
e47de03
100644
(file)
--- a/
examples/ipv4_header.ml
+++ b/
examples/ipv4_header.ml
@@
-4,7
+4,7
@@
open Printf
open Printf
-let header = Bit
match
.bitstring_of_file "ipv4_header.dat"
+let header = Bit
string
.bitstring_of_file "ipv4_header.dat"
let () =
bitmatch header with
let () =
bitmatch header with
@@
-29,13
+29,13
@@
let () =
printf " checksum: %d\n" checksum;
printf " source: %lx dest: %lx\n" source dest;
printf " header options + padding:\n";
printf " checksum: %d\n" checksum;
printf " source: %lx dest: %lx\n" source dest;
printf " header options + padding:\n";
- Bit
match
.hexdump_bitstring stdout options;
+ Bit
string
.hexdump_bitstring stdout options;
printf " packet payload:\n";
printf " packet payload:\n";
- Bit
match
.hexdump_bitstring stdout payload
+ Bit
string
.hexdump_bitstring stdout payload
| { version : 4 } ->
eprintf "cannot parse IP version %d\n" version
| { _ } as header ->
eprintf "data is smaller than one nibble:\n";
| { version : 4 } ->
eprintf "cannot parse IP version %d\n" version
| { _ } as header ->
eprintf "data is smaller than one nibble:\n";
- Bit
match
.hexdump_bitstring stderr header
+ Bit
string
.hexdump_bitstring stderr header