[cols="30%,70%"]
|=====
| Name | Description
+| `length=uint8` | When encoding or decoding the structure, it is prefixed by a `uint8` field containing the length of the structure.
| `length=uint16` | When encoding or decoding the structure, it is prefixed by a `uint16` field containing the length of the structure.
|=====
* with any other type of length.
*/
if (argc == 4) {
- if (strcmp(argv[3], "length=uint16") != 0) {
+ if (strcmp(argv[3], "length=uint16") == 0) {
+ flags.extra = 1;
+ flags.subtype = FLAG_LENGTH_UINT16;
+
+ } else if (strcmp(argv[3], "length=uint8") == 0) {
+ flags.extra = 1;
+ flags.subtype = FLAG_LENGTH_UINT8;
+
+ } else {
fr_strerror_printf("Unknown option '%s'", argv[3]);
return -1;
}
-
- flags.extra = 1;
- flags.subtype = FLAG_LENGTH_UINT16;
}
/*