build TLV option and return location of next */
| 123 | |
| 124 | /* build TLV option and return location of next */ |
| 125 | static struct pcapng_option * |
| 126 | pcapng_add_option(struct pcapng_option *popt, uint16_t code, |
| 127 | const void *data, uint16_t len) |
| 128 | { |
| 129 | popt->code = code; |
| 130 | popt->length = len; |
| 131 | if (len > 0) |
| 132 | memcpy(popt->data, data, len); |
| 133 | |
| 134 | return (struct pcapng_option *)((uint8_t *)popt + pcapng_optlen(len)); |
| 135 | } |
| 136 | |
| 137 | /* |
| 138 | * Write required initial section header describing the capture |
no test coverage detected