- channel = hdr.type - TRC_CH_B1;
-
- if (wth->capture.i4btrace->bchannel_prot[channel] == -1) {
- /*
- * We don't know yet whether the datastream is
- * V.120 or not; this heuristic tries to figure
- * that out.
- *
- * We cannot glean this from the Q.931 SETUP message,
- * because no commercial V.120 implementation I've
- * seen actually sets the V.120 protocol discriminator
- * (that, or I'm misreading the spec badly).
- *
- * TODO: reset the flag to -1 (unknown) after a close
- * on the B channel is detected.
- */
- if (memcmp(bufp, V120SABME, 3) == 0)
- wth->capture.i4btrace->bchannel_prot[channel] = 1;
- else
- wth->capture.i4btrace->bchannel_prot[channel] = 0;
- }
- if (wth->capture.i4btrace->bchannel_prot[channel] == 1) {
- /*
- * V.120.
- */
- wth->phdr.pkt_encap = WTAP_ENCAP_V120;
- } else {
- /*
- * Not V.120.
- *
- * XXX - what is it? It's probably not
- * WTAP_ENCAP_NULL, as that means it has a
- * 4-byte AF_ type as the encapsulation header.
- * If it's PPP, we should use WTAP_ENCAP_PPP here.
- */
- wth->phdr.pkt_encap = WTAP_ENCAP_NULL;
- }