From Jeff Foster: add support for Cisco HDLC captures.

svn path=/trunk/; revision=21598
This commit is contained in:
Guy Harris 2007-04-26 20:06:06 +00:00
parent 65b4512fe3
commit 235596a3c8
1 changed files with 9 additions and 0 deletions

View File

@ -132,6 +132,7 @@ struct netxray_hdr {
#define WAN_CAPTYPE_SMDS 10 /* SMDS DXI */
#define WAN_CAPTYPE_BROUTER4 11 /* Bridge/router captured with pod */
#define WAN_CAPTYPE_BROUTER5 12 /* Bridge/router captured with pod */
#define WAN_CAPTYPE_CHDLC 19 /* Cisco router (CHDLC) captured with pod */
#define CAPTYPE_ATM 15 /* ATM captured with pod */
@ -696,6 +697,13 @@ int netxray_open(wtap *wth, int *err, gchar **err_info)
file_encap = WTAP_ENCAP_SDLC;
break;
case WAN_CAPTYPE_CHDLC:
/*
* Cisco router (CHDLC) captured with pod
*/
file_encap = WTAP_ENCAP_CHDLC_WITH_PHDR;
break;
default:
*err = WTAP_ERR_UNSUPPORTED_ENCAP;
*err_info = g_strdup_printf("netxray: WAN capture subtype 0x%02x unknown or unsupported",
@ -1245,6 +1253,7 @@ netxray_set_pseudo_header(wtap *wth, const guint8 *pd, int len,
case WTAP_ENCAP_PPP_WITH_PHDR:
case WTAP_ENCAP_SDLC:
case WTAP_ENCAP_CHDLC_WITH_PHDR:
pseudo_header->p2p.sent =
(hdr->hdr_2_x.xxx[12] & 0x01) ? TRUE : FALSE;
break;