{ 241, WTAP_ENCAP_NETANALYZER_TRANSPARENT },
/* IP-over-Infiniband, as specified by RFC 4391 section 6 */
{ 242, WTAP_ENCAP_IP_OVER_IB },
+ /* ISO/IEC 13818-1 MPEG2-TS packets */
+ { 243, WTAP_ENCAP_MPEG_2_TS },
/*
* To repeat:
return FALSE;
}
- pseudo_header->sita.flags = sita_phdr[SITA_FLAGS_OFFSET];
- pseudo_header->sita.signals = sita_phdr[SITA_SIGNALS_OFFSET];
- pseudo_header->sita.errors1 = sita_phdr[SITA_ERRORS1_OFFSET];
- pseudo_header->sita.errors2 = sita_phdr[SITA_ERRORS2_OFFSET];
- pseudo_header->sita.proto = sita_phdr[SITA_PROTO_OFFSET];
+ pseudo_header->sita.sita_flags = sita_phdr[SITA_FLAGS_OFFSET];
+ pseudo_header->sita.sita_signals = sita_phdr[SITA_SIGNALS_OFFSET];
+ pseudo_header->sita.sita_errors1 = sita_phdr[SITA_ERRORS1_OFFSET];
+ pseudo_header->sita.sita_errors2 = sita_phdr[SITA_ERRORS2_OFFSET];
+ pseudo_header->sita.sita_proto = sita_phdr[SITA_PROTO_OFFSET];
return TRUE;
}
return -1; /* Read error */
phdr_len += size;
+
+ if (check_packet_size &&
+ packet_size < (guint)phdr_len) {
+ /*
+ * Uh-oh, the packet isn't big enough for the pseudo-
+ * header.
+ */
+ *err = WTAP_ERR_BAD_FILE;
+ *err_info = g_strdup_printf("pcap: ERF file has a %u-byte packet, too small for a pseudo-header with ex- and sub-headers (%d)",
+ packet_size, phdr_len);
+ return -1;
+ }
break;
case WTAP_ENCAP_I2C:
* Write the SITA header.
*/
memset(&sita_hdr, 0, sizeof(sita_hdr));
- sita_hdr[SITA_FLAGS_OFFSET] = pseudo_header->sita.flags;
- sita_hdr[SITA_SIGNALS_OFFSET] = pseudo_header->sita.signals;
- sita_hdr[SITA_ERRORS1_OFFSET] = pseudo_header->sita.errors1;
- sita_hdr[SITA_ERRORS2_OFFSET] = pseudo_header->sita.errors2;
- sita_hdr[SITA_PROTO_OFFSET] = pseudo_header->sita.proto;
+ sita_hdr[SITA_FLAGS_OFFSET] = pseudo_header->sita.sita_flags;
+ sita_hdr[SITA_SIGNALS_OFFSET] = pseudo_header->sita.sita_signals;
+ sita_hdr[SITA_ERRORS1_OFFSET] = pseudo_header->sita.sita_errors1;
+ sita_hdr[SITA_ERRORS2_OFFSET] = pseudo_header->sita.sita_errors2;
+ sita_hdr[SITA_PROTO_OFFSET] = pseudo_header->sita.sita_proto;
if (!wtap_dump_file_write(wdh, sita_hdr, sizeof(sita_hdr), err))
return FALSE;
wdh->bytes_dumped += sizeof(sita_hdr);