forked from mirage/mirage-tcpip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mirage#188 from djs55/cstruct.ppx
Remove cstruct.syntax, use cstruct.ppx
- Loading branch information
Showing
10 changed files
with
247 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
cstruct arp { | ||
uint16_t htype; | ||
uint16_t ptype; | ||
uint8_t hlen; | ||
uint8_t plen; | ||
uint16_t op; | ||
uint8_t sha[6]; | ||
uint32_t spa; | ||
uint8_t tha[6]; | ||
uint32_t tpa | ||
} as big_endian | ||
[%%cstruct | ||
type arp = { | ||
htype: uint16_t; | ||
ptype: uint16_t; | ||
hlen: uint8_t; | ||
plen: uint8_t; | ||
op: uint16_t; | ||
sha: uint8_t [@len 6]; | ||
spa: uint32_t; | ||
tha: uint8_t [@len 6]; | ||
tpa: uint32_t; | ||
} [@@big_endian] | ||
] | ||
|
||
cenum op { | ||
Op_request = 1; | ||
Op_reply | ||
} as uint16_t | ||
[@@cenum | ||
type op = | ||
| Op_request [@id 1] | ||
| Op_reply | ||
[@@uint16_t] | ||
] |
Oops, something went wrong.