Lines Matching refs:len
502 static uint16_t pcapng_optlen(size_t len) { in pcapng_optlen() argument
503 return ALIGN4(len + sizeof(struct pcapng_option)); in pcapng_optlen()
506 static void pcapng_putopt(FILE *f, uint16_t code, const void *data, size_t len) { in pcapng_putopt() argument
509 .length = len, in pcapng_putopt()
513 assert((uint16_t) len == len); in pcapng_putopt()
514 assert(data || len == 0); in pcapng_putopt()
517 if (len > 0) { in pcapng_putopt()
518 size_t pad = ALIGN4(len) - len; in pcapng_putopt()
520 fwrite(data, 1, len, f); in pcapng_putopt()
529 uint32_t len; in pcapng_section_header() local
534 len = sizeof(struct pcapng_section); in pcapng_section_header()
536 len += pcapng_optlen(strlen(os)); in pcapng_section_header()
538 len += pcapng_optlen(strlen(app)); in pcapng_section_header()
539 len += pcapng_optlen(0); /* OPT_END */ in pcapng_section_header()
540 len += sizeof(uint32_t); /* trailer length */ in pcapng_section_header()
544 .block_length = len, in pcapng_section_header()
557 fwrite(&len, 1, sizeof(uint32_t), f); in pcapng_section_header()
562 uint32_t len; in pcapng_interface_header() local
569 len = sizeof(struct pcapng_interface_block) + sizeof(uint32_t); in pcapng_interface_header()
572 .block_length = len, in pcapng_interface_header()
578 fwrite(&len, 1, sizeof(uint32_t), f); in pcapng_interface_header()