aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/erf.c16
-rw-r--r--wiretap/erf.h4
-rw-r--r--wiretap/wtap.h1
3 files changed, 20 insertions, 1 deletions
diff --git a/wiretap/erf.c b/wiretap/erf.c
index 3d572e4881..bb41f3c145 100644
--- a/wiretap/erf.c
+++ b/wiretap/erf.c
@@ -339,6 +339,7 @@ static gboolean erf_read_header(FILE_T fh,
{
union wtap_pseudo_header *pseudo_header = &phdr->pseudo_header;
guint32 mc_hdr;
+ guint32 aal2_hdr;
guint8 erf_exhdr[8];
guint64 erf_exhdr_sw;
guint8 type = 0;
@@ -463,7 +464,6 @@ static gboolean erf_read_header(FILE_T fh,
case ERF_TYPE_MC_AAL5:
case ERF_TYPE_MC_AAL2:
case ERF_TYPE_COLOR_MC_HDLC_POS:
- case ERF_TYPE_AAL2: /* not an MC type but has a similar 'AAL2 ext' header */
if (!wtap_read_bytes(fh, &mc_hdr, sizeof(mc_hdr), err, err_info))
return FALSE;
if (bytes_read != NULL)
@@ -473,6 +473,16 @@ static gboolean erf_read_header(FILE_T fh,
pseudo_header->erf.subhdr.mc_hdr = g_ntohl(mc_hdr);
break;
+ case ERF_TYPE_AAL2:
+ if (!wtap_read_bytes(fh, &aal2_hdr, sizeof(aal2_hdr), err, err_info))
+ return FALSE;
+ if (bytes_read != NULL)
+ *bytes_read += (guint32)sizeof(aal2_hdr);
+ *packet_size -= (guint32)sizeof(aal2_hdr);
+ skiplen += (guint32)sizeof(aal2_hdr);
+ pseudo_header->erf.subhdr.aal2_hdr = g_ntohl(aal2_hdr);
+ break;
+
case ERF_TYPE_IP_COUNTER:
case ERF_TYPE_TCP_FLOW_COUNTER:
/* unsupported, continue with default: */
@@ -546,6 +556,10 @@ static gboolean erf_write_phdr(wtap_dumper *wdh, int encap, const union wtap_pse
phtonl(&erf_subhdr[0], pseudo_header->erf.subhdr.mc_hdr);
subhdr_size += (int)sizeof(struct erf_mc_hdr);
break;
+ case ERF_TYPE_AAL2:
+ phtonl(&erf_subhdr[0], pseudo_header->erf.subhdr.aal2_hdr);
+ subhdr_size += (int)sizeof(struct erf_aal2_hdr);
+ break;
case ERF_TYPE_ETH:
case ERF_TYPE_COLOR_ETH:
case ERF_TYPE_DSM_COLOR_ETH:
diff --git a/wiretap/erf.h b/wiretap/erf.h
index 7922f5016f..894235c7ad 100644
--- a/wiretap/erf.h
+++ b/wiretap/erf.h
@@ -115,6 +115,10 @@ typedef struct erf_mc_hdr {
guint32 mc;
} erf_mc_header_t;
+typedef struct erf_aal2_hdr {
+ guint32 aal2;
+} erf_aal2_header_t;
+
typedef struct erf_eth_hdr {
guint16 eth;
} erf_eth_header_t;
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index 0335607b2a..39707abc15 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -940,6 +940,7 @@ struct erf_mc_phdr {
{
guint16 eth_hdr;
guint32 mc_hdr;
+ guint32 aal2_hdr;
} subhdr;
};