Beispiel #1
0
static void
capture_info_packet(packet_counts *counts, gint wtap_linktype, const guchar *pd, guint32 caplen, union wtap_pseudo_header *pseudo_header)
{
    capture_packet_info_t cpinfo;

    /* Setup the capture packet structure */
    cpinfo.counts = counts;

    counts->total++;
    if (!try_capture_dissector("wtap_encap", wtap_linktype, pd, 0, caplen, &cpinfo, pseudo_header))
        counts->other++;
}
Beispiel #2
0
static void
capture_info_packet(info_data_t* cap_info, gint wtap_linktype, const guchar *pd, guint32 caplen, union wtap_pseudo_header *pseudo_header)
{
    capture_packet_info_t cpinfo;

    /* Setup the capture packet structure */
    cpinfo.counts = cap_info->counts.counts_hash;

    cap_info->counts.total++;
    if (!try_capture_dissector("wtap_encap", wtap_linktype, pd, 0, caplen, &cpinfo, pseudo_header))
        cap_info->counts.other++;
}
Beispiel #3
0
static gboolean
capture_ap1394(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
{
  guint16    etype;

  if (!BYTES_ARE_IN_FRAME(offset, len, 18)) {
    return FALSE;
  }

  /* Skip destination and source addresses */
  offset += 16;

  etype = pntoh16(&pd[offset]);
  offset += 2;
  return try_capture_dissector("ethertype", etype, pd, offset, len, cpinfo, pseudo_header);
}
Beispiel #4
0
static gboolean
capture_enc(const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
{
  guint32 af;

  if (!BYTES_ARE_IN_FRAME(0, len, BSD_ENC_HDRLEN))
    return FALSE;

  memcpy((char *)&af, (const char *)&pd[0], sizeof(af));
  if ((af & 0xFFFF0000) != 0) {
    /*
     * BSD AF_ types will always have the upper 16 bits as 0, so if any
     * of them are non-zero, the af field must be byte-swapped, and
     * will, at least in DLT_ENC headers, always have at least one of
     * the lower 16 bits not being 0 (it won't be AF_UNSPEC, which is
     * 0), so if the af field is byte-swapped, at least one of the
     * upper 16 bits will be 0.
     */
    af = GUINT32_SWAP_LE_BE(af);
  }
  return try_capture_dissector("enc", af, pd, BSD_ENC_HDRLEN, len, cpinfo, pseudo_header);
}