2001-07-12 20:16:29 +00:00
|
|
|
/* packet-pgm.c
|
2003-12-19 22:46:16 +00:00
|
|
|
* Routines for PGM packet disassembly, RFC 3208
|
2001-07-12 20:16:29 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2001-07-12 20:16:29 +00:00
|
|
|
* Copyright (c) 2000 by Talarian Corp
|
2006-07-01 19:19:35 +00:00
|
|
|
* Rewritten by Jaap Keuter
|
2001-07-12 20:16:29 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2001-07-12 20:16:29 +00:00
|
|
|
* Copyright 1999 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2001-07-12 20:16:29 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
2006-07-01 19:19:35 +00:00
|
|
|
# include "config.h"
|
2001-07-12 20:16:29 +00:00
|
|
|
#endif
|
|
|
|
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2004-09-29 00:52:45 +00:00
|
|
|
#include <epan/afn.h>
|
|
|
|
#include <epan/ipproto.h>
|
2004-09-28 00:06:32 +00:00
|
|
|
#include <epan/in_cksum.h>
|
2004-08-06 19:57:49 +00:00
|
|
|
#include <epan/addr_resolv.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/strutil.h>
|
2004-09-27 22:55:15 +00:00
|
|
|
#include <epan/prefs.h>
|
2005-08-20 01:10:40 +00:00
|
|
|
#include <epan/emem.h>
|
2006-07-01 19:19:35 +00:00
|
|
|
#include <epan/ptvcursor.h>
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2003-03-12 04:04:15 +00:00
|
|
|
/*
|
|
|
|
* Flag to control whether to check the PGM checksum.
|
|
|
|
*/
|
|
|
|
static gboolean pgm_check_checksum = TRUE;
|
|
|
|
|
2001-07-12 20:16:29 +00:00
|
|
|
void proto_reg_handoff_pgm(void);
|
2001-08-06 19:05:14 +00:00
|
|
|
|
2002-04-14 23:04:04 +00:00
|
|
|
/* constants for hdr types */
|
|
|
|
#define PGM_SPM_PCKT 0x00
|
|
|
|
#define PGM_ODATA_PCKT 0x04
|
|
|
|
#define PGM_RDATA_PCKT 0x05
|
|
|
|
#define PGM_NAK_PCKT 0x08
|
|
|
|
#define PGM_NNAK_PCKT 0x09
|
|
|
|
#define PGM_NCF_PCKT 0x0A
|
2003-03-12 04:04:15 +00:00
|
|
|
#define PGM_POLL_PCKT 0x01
|
|
|
|
#define PGM_POLR_PCKT 0x02
|
2002-04-14 23:04:04 +00:00
|
|
|
#define PGM_ACK_PCKT 0x0D
|
|
|
|
|
|
|
|
/* option flags (main PGM header) */
|
|
|
|
#define PGM_OPT 0x01
|
|
|
|
#define PGM_OPT_NETSIG 0x02
|
|
|
|
#define PGM_OPT_VAR_PKTLEN 0x40
|
|
|
|
#define PGM_OPT_PARITY 0x80
|
|
|
|
|
|
|
|
/* option types */
|
|
|
|
#define PGM_OPT_LENGTH 0x00
|
|
|
|
#define PGM_OPT_END 0x80
|
|
|
|
#define PGM_OPT_FRAGMENT 0x01
|
|
|
|
#define PGM_OPT_NAK_LIST 0x02
|
|
|
|
#define PGM_OPT_JOIN 0x03
|
|
|
|
#define PGM_OPT_REDIRECT 0x07
|
|
|
|
#define PGM_OPT_SYN 0x0D
|
|
|
|
#define PGM_OPT_FIN 0x0E
|
|
|
|
#define PGM_OPT_RST 0x0F
|
|
|
|
#define PGM_OPT_PARITY_PRM 0x08
|
|
|
|
#define PGM_OPT_PARITY_GRP 0x09
|
|
|
|
#define PGM_OPT_CURR_TGSIZE 0x0A
|
|
|
|
#define PGM_OPT_PGMCC_DATA 0x12
|
|
|
|
#define PGM_OPT_PGMCC_FEEDBACK 0x13
|
2003-03-12 04:04:15 +00:00
|
|
|
#define PGM_OPT_NAK_BO_IVL 0x04
|
|
|
|
#define PGM_OPT_NAK_BO_RNG 0x05
|
|
|
|
|
|
|
|
/* POLL subtypes */
|
|
|
|
#define PGM_POLL_GENERAL 0x0
|
|
|
|
#define PGM_POLL_DLR 0x1
|
2002-04-14 23:04:04 +00:00
|
|
|
|
|
|
|
/* OPX bit values */
|
|
|
|
#define PGM_OPX_IGNORE 0x00
|
|
|
|
#define PGM_OPX_INVAL 0x01
|
|
|
|
#define PGM_OPX_DISCARD 0x10
|
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
#define PGM_OPT_NAK_LIST_SIZE 4
|
2002-04-14 23:04:04 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/*
|
2002-04-14 23:04:04 +00:00
|
|
|
* To squeeze the whole option into 255 bytes, we
|
|
|
|
* can only have 62 in the list
|
|
|
|
*/
|
|
|
|
#define PGM_MAX_NAK_LIST_SZ (62)
|
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
#define PGM_OPT_JOIN_SIZE 8
|
|
|
|
#define PGM_OPT_PARITY_PRM_SIZE 8
|
2002-04-14 23:04:04 +00:00
|
|
|
|
|
|
|
/* OPT_PARITY_PRM P and O bits */
|
2006-07-01 19:19:35 +00:00
|
|
|
#define PGM_OPT_PARITY_PRM_PRO 0x2
|
|
|
|
#define PGM_OPT_PARITY_PRM_OND 0x1
|
|
|
|
|
|
|
|
#define PGM_OPT_PARITY_GRP_SIZE 8
|
|
|
|
#define PGM_OPT_CURR_TGSIZE_SIZE 8
|
|
|
|
#define PGM_OPT_PGMCC_DATA_SIZE 16
|
|
|
|
#define PGM_OPT_PGMCC_FEEDBACK_SIZE 16
|
|
|
|
#define PGM_OPT_NAK_BO_IVL_SIZE 12
|
|
|
|
#define PGM_OPT_NAK_BO_RNG_SIZE 12
|
|
|
|
#define PGM_OPT_REDIRECT_SIZE 12
|
|
|
|
#define PGM_OPT_FRAGMENT_SIZE 16
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2002-04-14 23:04:04 +00:00
|
|
|
/*
|
|
|
|
* Udp port for UDP encapsulation
|
|
|
|
*/
|
|
|
|
#define DEFAULT_UDP_ENCAP_UCAST_PORT 3055
|
|
|
|
#define DEFAULT_UDP_ENCAP_MCAST_PORT 3056
|
|
|
|
|
2005-07-09 00:53:17 +00:00
|
|
|
static guint udp_encap_ucast_port = 0;
|
|
|
|
static guint udp_encap_mcast_port = 0;
|
2001-07-12 20:16:29 +00:00
|
|
|
|
|
|
|
static int proto_pgm = -1;
|
|
|
|
static int ett_pgm = -1;
|
|
|
|
static int ett_pgm_optbits = -1;
|
|
|
|
static int ett_pgm_opts = -1;
|
|
|
|
static int ett_pgm_spm = -1;
|
|
|
|
static int ett_pgm_data = -1;
|
|
|
|
static int ett_pgm_nak = -1;
|
2003-03-12 04:04:15 +00:00
|
|
|
static int ett_pgm_poll = -1;
|
|
|
|
static int ett_pgm_polr = -1;
|
2001-08-02 17:05:00 +00:00
|
|
|
static int ett_pgm_ack = -1;
|
2001-07-12 20:16:29 +00:00
|
|
|
static int ett_pgm_opts_join = -1;
|
|
|
|
static int ett_pgm_opts_parityprm = -1;
|
|
|
|
static int ett_pgm_opts_paritygrp = -1;
|
|
|
|
static int ett_pgm_opts_naklist = -1;
|
2001-08-02 17:05:00 +00:00
|
|
|
static int ett_pgm_opts_ccdata = -1;
|
2003-03-12 04:04:15 +00:00
|
|
|
static int ett_pgm_opts_nak_bo_ivl = -1;
|
|
|
|
static int ett_pgm_opts_nak_bo_rng = -1;
|
|
|
|
static int ett_pgm_opts_redirect = -1;
|
|
|
|
static int ett_pgm_opts_fragment = -1;
|
2001-07-12 20:16:29 +00:00
|
|
|
|
|
|
|
static int hf_pgm_main_sport = -1;
|
|
|
|
static int hf_pgm_main_dport = -1;
|
2004-12-26 00:22:16 +00:00
|
|
|
static int hf_pgm_port = -1;
|
2001-07-12 20:16:29 +00:00
|
|
|
static int hf_pgm_main_type = -1;
|
|
|
|
static int hf_pgm_main_opts = -1;
|
|
|
|
static int hf_pgm_main_opts_opt = -1;
|
|
|
|
static int hf_pgm_main_opts_netsig = -1;
|
|
|
|
static int hf_pgm_main_opts_varlen = -1;
|
|
|
|
static int hf_pgm_main_opts_parity = -1;
|
|
|
|
static int hf_pgm_main_cksum = -1;
|
2003-03-12 04:04:15 +00:00
|
|
|
static int hf_pgm_main_cksum_bad = -1;
|
2001-07-12 20:16:29 +00:00
|
|
|
static int hf_pgm_main_gsi = -1;
|
|
|
|
static int hf_pgm_main_tsdulen = -1;
|
|
|
|
static int hf_pgm_spm_sqn = -1;
|
|
|
|
static int hf_pgm_spm_lead = -1;
|
|
|
|
static int hf_pgm_spm_trail = -1;
|
|
|
|
static int hf_pgm_spm_pathafi = -1;
|
|
|
|
static int hf_pgm_spm_res = -1;
|
|
|
|
static int hf_pgm_spm_path = -1;
|
2006-07-01 19:19:35 +00:00
|
|
|
static int hf_pgm_spm_path6 = -1;
|
2001-07-12 20:16:29 +00:00
|
|
|
static int hf_pgm_data_sqn = -1;
|
|
|
|
static int hf_pgm_data_trail = -1;
|
|
|
|
static int hf_pgm_nak_sqn = -1;
|
|
|
|
static int hf_pgm_nak_srcafi = -1;
|
|
|
|
static int hf_pgm_nak_srcres = -1;
|
|
|
|
static int hf_pgm_nak_src = -1;
|
2006-07-01 19:19:35 +00:00
|
|
|
static int hf_pgm_nak_src6 = -1;
|
2001-07-12 20:16:29 +00:00
|
|
|
static int hf_pgm_nak_grpafi = -1;
|
|
|
|
static int hf_pgm_nak_grpres = -1;
|
|
|
|
static int hf_pgm_nak_grp = -1;
|
2006-07-01 19:19:35 +00:00
|
|
|
static int hf_pgm_nak_grp6 = -1;
|
2003-03-12 04:04:15 +00:00
|
|
|
static int hf_pgm_poll_sqn = -1;
|
|
|
|
static int hf_pgm_poll_round = -1;
|
|
|
|
static int hf_pgm_poll_subtype = -1;
|
|
|
|
static int hf_pgm_poll_pathafi = -1;
|
|
|
|
static int hf_pgm_poll_res = -1;
|
|
|
|
static int hf_pgm_poll_path = -1;
|
2006-07-01 19:19:35 +00:00
|
|
|
static int hf_pgm_poll_path6 = -1;
|
2003-03-12 04:04:15 +00:00
|
|
|
static int hf_pgm_poll_backoff_ivl = -1;
|
|
|
|
static int hf_pgm_poll_rand_str = -1;
|
|
|
|
static int hf_pgm_poll_matching_bmask = -1;
|
|
|
|
static int hf_pgm_polr_sqn = -1;
|
|
|
|
static int hf_pgm_polr_round = -1;
|
|
|
|
static int hf_pgm_polr_res = -1;
|
2001-08-02 17:05:00 +00:00
|
|
|
static int hf_pgm_ack_sqn = -1;
|
|
|
|
static int hf_pgm_ack_bitmap = -1;
|
2001-07-12 20:16:29 +00:00
|
|
|
|
|
|
|
static int hf_pgm_opt_type = -1;
|
|
|
|
static int hf_pgm_opt_len = -1;
|
|
|
|
static int hf_pgm_opt_tlen = -1;
|
|
|
|
|
2010-05-27 21:54:58 +00:00
|
|
|
static int hf_pgm_genopt_end = -1;
|
2001-07-12 20:16:29 +00:00
|
|
|
static int hf_pgm_genopt_type = -1;
|
|
|
|
static int hf_pgm_genopt_len = -1;
|
|
|
|
static int hf_pgm_genopt_opx = -1;
|
|
|
|
|
|
|
|
static int hf_pgm_opt_join_res = -1;
|
|
|
|
static int hf_pgm_opt_join_minjoin = -1;
|
|
|
|
|
|
|
|
static int hf_pgm_opt_parity_prm_po = -1;
|
|
|
|
static int hf_pgm_opt_parity_prm_prmtgsz = -1;
|
|
|
|
|
|
|
|
static int hf_pgm_opt_parity_grp_res = -1;
|
|
|
|
static int hf_pgm_opt_parity_grp_prmgrp = -1;
|
|
|
|
|
|
|
|
static int hf_pgm_opt_nak_res = -1;
|
|
|
|
static int hf_pgm_opt_nak_list = -1;
|
|
|
|
|
2001-08-02 17:05:00 +00:00
|
|
|
static int hf_pgm_opt_ccdata_res = -1;
|
|
|
|
static int hf_pgm_opt_ccdata_tsp = -1;
|
|
|
|
static int hf_pgm_opt_ccdata_afi = -1;
|
|
|
|
static int hf_pgm_opt_ccdata_res2 = -1;
|
|
|
|
static int hf_pgm_opt_ccdata_acker = -1;
|
2006-07-01 19:19:35 +00:00
|
|
|
static int hf_pgm_opt_ccdata_acker6 = -1;
|
2001-08-02 17:05:00 +00:00
|
|
|
|
|
|
|
static int hf_pgm_opt_ccfeedbk_res = -1;
|
|
|
|
static int hf_pgm_opt_ccfeedbk_tsp = -1;
|
|
|
|
static int hf_pgm_opt_ccfeedbk_afi = -1;
|
|
|
|
static int hf_pgm_opt_ccfeedbk_lossrate = -1;
|
|
|
|
static int hf_pgm_opt_ccfeedbk_acker = -1;
|
2006-07-01 19:19:35 +00:00
|
|
|
static int hf_pgm_opt_ccfeedbk_acker6 = -1;
|
2001-08-02 17:05:00 +00:00
|
|
|
|
2003-03-12 04:04:15 +00:00
|
|
|
static int hf_pgm_opt_nak_bo_ivl_res = -1;
|
|
|
|
static int hf_pgm_opt_nak_bo_ivl_bo_ivl = -1;
|
|
|
|
static int hf_pgm_opt_nak_bo_ivl_bo_ivl_sqn = -1;
|
|
|
|
|
|
|
|
static int hf_pgm_opt_nak_bo_rng_res = -1;
|
|
|
|
static int hf_pgm_opt_nak_bo_rng_min_bo_ivl = -1;
|
|
|
|
static int hf_pgm_opt_nak_bo_rng_max_bo_ivl = -1;
|
|
|
|
|
|
|
|
static int hf_pgm_opt_redirect_res = -1;
|
|
|
|
static int hf_pgm_opt_redirect_afi = -1;
|
|
|
|
static int hf_pgm_opt_redirect_res2 = -1;
|
|
|
|
static int hf_pgm_opt_redirect_dlr = -1;
|
2006-07-01 19:19:35 +00:00
|
|
|
static int hf_pgm_opt_redirect_dlr6 = -1;
|
2003-03-12 04:04:15 +00:00
|
|
|
|
|
|
|
static int hf_pgm_opt_fragment_res = -1;
|
|
|
|
static int hf_pgm_opt_fragment_first_sqn = -1;
|
|
|
|
static int hf_pgm_opt_fragment_offset = -1;
|
|
|
|
static int hf_pgm_opt_fragment_total_length = -1;
|
|
|
|
|
2001-08-02 17:05:00 +00:00
|
|
|
static dissector_table_t subdissector_table;
|
|
|
|
static heur_dissector_list_t heur_subdissector_list;
|
2001-11-25 22:51:14 +00:00
|
|
|
static dissector_handle_t data_handle;
|
2001-08-02 17:05:00 +00:00
|
|
|
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2005-08-05 00:23:22 +00:00
|
|
|
static const char *
|
2006-07-01 19:19:35 +00:00
|
|
|
optsstr(guint8 opts)
|
2001-07-12 20:16:29 +00:00
|
|
|
{
|
2005-08-20 01:10:40 +00:00
|
|
|
char *msg;
|
2010-01-19 00:37:39 +00:00
|
|
|
gint returned_length, idx = 0;
|
2006-01-20 21:18:18 +00:00
|
|
|
const int MAX_STR_LEN = 256;
|
2006-07-01 19:19:35 +00:00
|
|
|
|
2001-07-12 20:16:29 +00:00
|
|
|
if (opts == 0)
|
|
|
|
return("");
|
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
msg=ep_alloc(MAX_STR_LEN);
|
2001-07-12 20:16:29 +00:00
|
|
|
if (opts & PGM_OPT){
|
2010-01-19 00:37:39 +00:00
|
|
|
returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "Present");
|
|
|
|
idx += MIN(returned_length, MAX_STR_LEN-idx);
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
|
|
|
if (opts & PGM_OPT_NETSIG){
|
2010-01-19 00:37:39 +00:00
|
|
|
returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "%sNetSig", (!idx)?"":",");
|
|
|
|
idx += MIN(returned_length, MAX_STR_LEN-idx);
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
|
|
|
if (opts & PGM_OPT_VAR_PKTLEN){
|
2010-01-19 00:37:39 +00:00
|
|
|
returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "%sVarLen", (!idx)?"":",");
|
|
|
|
idx += MIN(returned_length, MAX_STR_LEN-idx);
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
|
|
|
if (opts & PGM_OPT_PARITY){
|
2010-01-19 00:37:39 +00:00
|
|
|
returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "%sParity", (!idx)?"":",");
|
|
|
|
idx += MIN(returned_length, MAX_STR_LEN-idx);
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
2010-01-19 00:37:39 +00:00
|
|
|
if (!idx) {
|
|
|
|
g_snprintf(&msg[idx], MAX_STR_LEN-idx, "0x%x", opts);
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
|
|
|
return(msg);
|
|
|
|
}
|
2005-08-05 00:23:22 +00:00
|
|
|
static const char *
|
2006-07-01 19:19:35 +00:00
|
|
|
paritystr(guint8 parity)
|
2001-08-02 17:05:00 +00:00
|
|
|
{
|
2005-08-20 01:10:40 +00:00
|
|
|
char *msg;
|
2010-01-19 00:37:39 +00:00
|
|
|
gint returned_length, idx = 0;
|
2006-01-20 21:18:18 +00:00
|
|
|
const int MAX_STR_LEN = 256;
|
2001-08-02 17:05:00 +00:00
|
|
|
|
|
|
|
if (parity == 0)
|
|
|
|
return("");
|
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
msg=ep_alloc(MAX_STR_LEN);
|
2001-08-02 17:05:00 +00:00
|
|
|
if (parity & PGM_OPT_PARITY_PRM_PRO){
|
2010-01-19 00:37:39 +00:00
|
|
|
returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "Pro-active");
|
|
|
|
idx += MIN(returned_length, MAX_STR_LEN-idx);
|
2001-08-02 17:05:00 +00:00
|
|
|
}
|
|
|
|
if (parity & PGM_OPT_PARITY_PRM_OND){
|
2010-01-19 00:37:39 +00:00
|
|
|
returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "%sOn-demand", (!idx)?"":",");
|
|
|
|
idx += MIN(returned_length, MAX_STR_LEN-idx);
|
2001-08-02 17:05:00 +00:00
|
|
|
}
|
2010-01-19 00:37:39 +00:00
|
|
|
if (!idx) {
|
|
|
|
g_snprintf(&msg[idx], MAX_STR_LEN-idx, "0x%x", parity);
|
2001-08-02 17:05:00 +00:00
|
|
|
}
|
|
|
|
return(msg);
|
|
|
|
}
|
2001-07-20 23:21:33 +00:00
|
|
|
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
static const value_string opt_vals[] = {
|
|
|
|
{ PGM_OPT_LENGTH, "Length" },
|
|
|
|
{ PGM_OPT_END, "End" },
|
|
|
|
{ PGM_OPT_FRAGMENT, "Fragment" },
|
|
|
|
{ PGM_OPT_NAK_LIST, "NakList" },
|
|
|
|
{ PGM_OPT_JOIN, "Join" },
|
|
|
|
{ PGM_OPT_REDIRECT, "ReDirect" },
|
|
|
|
{ PGM_OPT_SYN, "Syn" },
|
|
|
|
{ PGM_OPT_FIN, "Fin" },
|
|
|
|
{ PGM_OPT_RST, "Rst" },
|
|
|
|
{ PGM_OPT_PARITY_PRM, "ParityPrm" },
|
|
|
|
{ PGM_OPT_PARITY_GRP, "ParityGrp" },
|
|
|
|
{ PGM_OPT_CURR_TGSIZE, "CurrTgsiz" },
|
2001-08-02 17:05:00 +00:00
|
|
|
{ PGM_OPT_PGMCC_DATA, "CcData" },
|
|
|
|
{ PGM_OPT_PGMCC_FEEDBACK, "CcFeedBack" },
|
2003-03-12 04:04:15 +00:00
|
|
|
{ PGM_OPT_NAK_BO_IVL, "NakBackOffIvl" },
|
|
|
|
{ PGM_OPT_NAK_BO_RNG, "NakBackOffRng" },
|
|
|
|
{ PGM_OPT_FRAGMENT, "Fragment" },
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
2001-07-12 20:16:29 +00:00
|
|
|
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
static const value_string opx_vals[] = {
|
|
|
|
{ PGM_OPX_IGNORE, "Ignore" },
|
|
|
|
{ PGM_OPX_INVAL, "Inval" },
|
|
|
|
{ PGM_OPX_DISCARD, "DisCard" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
static const true_false_string opts_present = {
|
|
|
|
"Present",
|
|
|
|
"Not Present"
|
|
|
|
};
|
|
|
|
|
2001-07-12 20:16:29 +00:00
|
|
|
static void
|
2006-07-01 19:19:35 +00:00
|
|
|
dissect_pgmopts(ptvcursor_t* cursor, const char *pktname)
|
2001-07-12 20:16:29 +00:00
|
|
|
{
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *opts_tree = NULL;
|
|
|
|
proto_tree *opt_tree = NULL;
|
2006-07-01 19:19:35 +00:00
|
|
|
tvbuff_t *tvb = ptvcursor_tvbuff(cursor);
|
|
|
|
|
|
|
|
gboolean theend = FALSE;
|
|
|
|
|
|
|
|
guint16 opts_total_len;
|
|
|
|
guint8 genopts_type;
|
|
|
|
guint8 genopts_len;
|
|
|
|
guint8 opts_type = tvb_get_guint8(tvb, ptvcursor_current_offset(cursor));
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (opts_type != PGM_OPT_LENGTH) {
|
|
|
|
proto_tree_add_text(ptvcursor_tree(cursor), tvb, ptvcursor_current_offset(cursor), 1,
|
2004-03-09 06:46:03 +00:00
|
|
|
"%s Options - initial option is %s, should be %s",
|
|
|
|
pktname,
|
2006-07-01 19:19:35 +00:00
|
|
|
val_to_str(opts_type, opt_vals, "Unknown (0x%02x)"),
|
2004-03-09 06:46:03 +00:00
|
|
|
val_to_str(PGM_OPT_LENGTH, opt_vals, "Unknown (0x%02x)"));
|
|
|
|
return;
|
|
|
|
}
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
opts_total_len = tvb_get_ntohs(tvb, ptvcursor_current_offset(cursor)+2);
|
2011-08-08 17:59:32 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (opts_total_len < 4) {
|
|
|
|
proto_tree_add_text(opts_tree, tvb, ptvcursor_current_offset(cursor)+2, 2,
|
2004-03-09 06:46:03 +00:00
|
|
|
"%s Options (Total Length %u - invalid, must be >= 4)",
|
2006-07-01 19:19:35 +00:00
|
|
|
pktname, opts_total_len);
|
2004-03-09 06:46:03 +00:00
|
|
|
return;
|
|
|
|
}
|
2011-08-08 17:59:32 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
tf = proto_tree_add_text(ptvcursor_tree(cursor), tvb, ptvcursor_current_offset(cursor), opts_total_len,
|
|
|
|
"%s Options (Total Length %d)", pktname, opts_total_len);
|
2001-07-12 20:16:29 +00:00
|
|
|
opts_tree = proto_item_add_subtree(tf, ett_pgm_opts);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opts_tree);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_type, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_len, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_tlen, 2, FALSE);
|
|
|
|
|
|
|
|
for (opts_total_len -= 4; !theend && opts_total_len != 0;){
|
|
|
|
if (opts_total_len < 4) {
|
|
|
|
proto_tree_add_text(opts_tree, tvb, ptvcursor_current_offset(cursor), opts_total_len,
|
2004-03-09 06:46:03 +00:00
|
|
|
"Remaining total options length doesn't have enough for an options header");
|
|
|
|
break;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
|
|
|
|
genopts_type = tvb_get_guint8(tvb, ptvcursor_current_offset(cursor));
|
|
|
|
genopts_len = tvb_get_guint8(tvb, ptvcursor_current_offset(cursor)+1);
|
|
|
|
|
|
|
|
if (genopts_type & PGM_OPT_END) {
|
|
|
|
genopts_type &= ~PGM_OPT_END;
|
2004-03-09 06:46:03 +00:00
|
|
|
theend = TRUE;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
if (genopts_len < 4) {
|
|
|
|
proto_tree_add_text(opts_tree, tvb, ptvcursor_current_offset(cursor), genopts_len,
|
2004-03-09 06:46:03 +00:00
|
|
|
"Option: %s, Length: %u (invalid, must be >= 4)",
|
2006-07-01 19:19:35 +00:00
|
|
|
val_to_str(genopts_type, opt_vals, "Unknown (0x%02x)"),
|
|
|
|
genopts_len);
|
2004-03-09 06:46:03 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
if (opts_total_len < genopts_len) {
|
|
|
|
proto_tree_add_text(opts_tree, tvb, ptvcursor_current_offset(cursor), genopts_len,
|
2004-03-09 06:46:03 +00:00
|
|
|
"Option: %s, Length: %u (> remaining total options length)",
|
2006-07-01 19:19:35 +00:00
|
|
|
val_to_str(genopts_type, opt_vals, "Unknown (0x%02x)"),
|
|
|
|
genopts_len);
|
2004-03-09 06:46:03 +00:00
|
|
|
break;
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
tf = proto_tree_add_text(opts_tree, tvb, ptvcursor_current_offset(cursor), genopts_len,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
"Option: %s, Length: %u",
|
2006-07-01 19:19:35 +00:00
|
|
|
val_to_str(genopts_type, opt_vals, "Unknown (0x%02x)"),
|
|
|
|
genopts_len);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
switch(genopts_type) {
|
2001-07-12 20:16:29 +00:00
|
|
|
case PGM_OPT_JOIN:{
|
|
|
|
opt_tree = proto_item_add_subtree(tf, ett_pgm_opts_join);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opt_tree);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, FALSE);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_type, 1, FALSE);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (genopts_len < PGM_OPT_JOIN_SIZE) {
|
2004-03-09 06:46:03 +00:00
|
|
|
proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb,
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_current_offset(cursor), 1, genopts_len,
|
|
|
|
"Length: %u (bogus, must be >= %u)",
|
|
|
|
genopts_len, PGM_OPT_JOIN_SIZE);
|
2004-03-09 06:46:03 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_len, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_opx, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_join_res, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_join_minjoin, 4, FALSE);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PGM_OPT_PARITY_PRM:{
|
2006-07-01 19:19:35 +00:00
|
|
|
guint8 optdata_po;
|
2001-07-12 20:16:29 +00:00
|
|
|
|
|
|
|
opt_tree = proto_item_add_subtree(tf, ett_pgm_opts_parityprm);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opt_tree);
|
|
|
|
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, FALSE);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_type, 1, FALSE);
|
2010-05-27 21:54:58 +00:00
|
|
|
|
2011-08-08 17:59:32 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (genopts_len < PGM_OPT_PARITY_PRM_SIZE) {
|
|
|
|
proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, ptvcursor_tvbuff(cursor),
|
|
|
|
ptvcursor_current_offset(cursor), 1, genopts_len,
|
|
|
|
"Length: %u (bogus, must be >= %u)",
|
|
|
|
genopts_len, PGM_OPT_PARITY_PRM_SIZE);
|
2004-03-09 06:46:03 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_len, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_opx, 1, FALSE);
|
|
|
|
optdata_po = tvb_get_guint8(tvb, ptvcursor_current_offset(cursor));
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_uint_format(opt_tree, hf_pgm_opt_parity_prm_po, tvb,
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_current_offset(cursor), 1, optdata_po, "Parity Parameters: %s (0x%x)",
|
|
|
|
paritystr(optdata_po), optdata_po);
|
|
|
|
ptvcursor_advance(cursor, 1);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_parity_prm_prmtgsz, 4, FALSE);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PGM_OPT_PARITY_GRP:{
|
|
|
|
opt_tree = proto_item_add_subtree(tf, ett_pgm_opts_paritygrp);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opt_tree);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, FALSE);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_type, 1, FALSE);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (genopts_len < PGM_OPT_PARITY_GRP_SIZE) {
|
2004-03-09 06:46:03 +00:00
|
|
|
proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb,
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_current_offset(cursor), 1, genopts_len,
|
|
|
|
"Length: %u (bogus, must be >= %u)",
|
|
|
|
genopts_len, PGM_OPT_PARITY_GRP_SIZE);
|
2004-03-09 06:46:03 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_len, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_opx, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_parity_grp_res, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_parity_grp_prmgrp, 4, FALSE);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PGM_OPT_NAK_LIST:{
|
2006-07-01 19:19:35 +00:00
|
|
|
guint8 optdata_len;
|
|
|
|
guint32 naklist[PGM_MAX_NAK_LIST_SZ+1];
|
|
|
|
unsigned char *nakbuf;
|
|
|
|
gboolean firsttime;
|
|
|
|
int i, j, naks, soffset;
|
2001-07-12 20:16:29 +00:00
|
|
|
|
|
|
|
opt_tree = proto_item_add_subtree(tf, ett_pgm_opts_naklist);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opt_tree);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, FALSE);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_type, 1, FALSE);
|
2011-08-08 17:59:32 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
optdata_len = tvb_get_guint8(tvb, ptvcursor_current_offset(cursor));
|
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_len, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_opx, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_nak_res, 1, FALSE);
|
2011-08-08 17:59:32 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
optdata_len -= PGM_OPT_NAK_LIST_SIZE;
|
|
|
|
tvb_memcpy(tvb, (guint8 *)naklist, ptvcursor_current_offset(cursor), optdata_len);
|
|
|
|
firsttime = TRUE;
|
|
|
|
soffset = 0;
|
|
|
|
naks = (optdata_len/sizeof(guint32));
|
|
|
|
nakbuf = ep_alloc(8192);
|
2001-07-12 20:16:29 +00:00
|
|
|
j = 0;
|
|
|
|
/*
|
2002-08-28 21:04:11 +00:00
|
|
|
* Print out 8 per line
|
2001-07-12 20:16:29 +00:00
|
|
|
*/
|
|
|
|
for (i=0; i < naks; i++) {
|
2006-01-20 21:18:18 +00:00
|
|
|
soffset += MIN(8192-soffset,
|
|
|
|
g_snprintf(nakbuf+soffset, 8192-soffset, "0x%lx ",
|
|
|
|
(unsigned long)g_ntohl(naklist[i])));
|
2001-07-12 20:16:29 +00:00
|
|
|
if ((++j % 8) == 0) {
|
|
|
|
if (firsttime) {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_bytes_format(opt_tree,
|
2006-07-01 19:19:35 +00:00
|
|
|
hf_pgm_opt_nak_list, tvb, ptvcursor_current_offset(cursor), j*4,
|
2008-12-19 17:39:52 +00:00
|
|
|
nakbuf, "List(%d): %s", naks, nakbuf);
|
2006-07-01 19:19:35 +00:00
|
|
|
soffset = 0;
|
|
|
|
firsttime = FALSE;
|
2001-07-12 20:16:29 +00:00
|
|
|
} else {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_bytes_format(opt_tree,
|
2006-07-01 19:19:35 +00:00
|
|
|
hf_pgm_opt_nak_list, tvb, ptvcursor_current_offset(cursor), j*4,
|
2008-12-19 17:39:52 +00:00
|
|
|
nakbuf, "List: %s", nakbuf);
|
2006-07-01 19:19:35 +00:00
|
|
|
soffset = 0;
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_advance(cursor, j*4);
|
|
|
|
j = 0;
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
if (j) {
|
2001-07-12 20:16:29 +00:00
|
|
|
if (firsttime) {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_bytes_format(opt_tree,
|
2006-07-01 19:19:35 +00:00
|
|
|
hf_pgm_opt_nak_list, tvb, ptvcursor_current_offset(cursor), j*4,
|
2008-12-19 17:39:52 +00:00
|
|
|
nakbuf, "List(%d): %s", naks, nakbuf);
|
2001-07-12 20:16:29 +00:00
|
|
|
} else {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_bytes_format(opt_tree,
|
2006-07-01 19:19:35 +00:00
|
|
|
hf_pgm_opt_nak_list, tvb, ptvcursor_current_offset(cursor), j*4,
|
2008-12-19 17:39:52 +00:00
|
|
|
nakbuf, "List: %s", nakbuf);
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_advance(cursor, j*4);
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2001-08-02 17:05:00 +00:00
|
|
|
case PGM_OPT_PGMCC_DATA:{
|
2006-07-01 19:19:35 +00:00
|
|
|
guint16 optdata_afi;
|
2001-08-02 17:05:00 +00:00
|
|
|
|
|
|
|
opt_tree = proto_item_add_subtree(tf, ett_pgm_opts_ccdata);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opt_tree);
|
2001-08-02 17:05:00 +00:00
|
|
|
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, FALSE);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_type, 1, FALSE);
|
2001-08-02 17:05:00 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (genopts_len < PGM_OPT_PGMCC_DATA_SIZE) {
|
2004-03-09 06:46:03 +00:00
|
|
|
proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb,
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_current_offset(cursor), 1, genopts_len,
|
|
|
|
"Length: %u (bogus, must be >= %u)",
|
|
|
|
genopts_len, PGM_OPT_PGMCC_DATA_SIZE);
|
2004-03-09 06:46:03 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_len, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_opx, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccdata_res, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccdata_tsp, 4, FALSE);
|
|
|
|
optdata_afi = tvb_get_ntohs(tvb, ptvcursor_current_offset(cursor));
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccdata_afi, 2, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccdata_res2, 2, FALSE);
|
2004-03-09 06:46:03 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
switch (optdata_afi) {
|
2001-08-02 17:05:00 +00:00
|
|
|
|
|
|
|
case AFNUM_INET:
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccdata_acker, 4, FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AFNUM_INET6:
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccdata_acker6, 16, FALSE);
|
2001-08-02 17:05:00 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2011-08-08 17:59:32 +00:00
|
|
|
proto_tree_add_text(opt_tree, tvb, ptvcursor_current_offset(cursor), -1,
|
2006-07-01 19:19:35 +00:00
|
|
|
"Can't handle this address format");
|
2001-08-02 17:05:00 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PGM_OPT_PGMCC_FEEDBACK:{
|
2006-07-01 19:19:35 +00:00
|
|
|
guint16 optdata_afi;
|
2001-08-02 17:05:00 +00:00
|
|
|
|
|
|
|
opt_tree = proto_item_add_subtree(tf, ett_pgm_opts_ccdata);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opt_tree);
|
2001-08-02 17:05:00 +00:00
|
|
|
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, FALSE);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_type, 1, FALSE);
|
2001-08-02 17:05:00 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (genopts_len < PGM_OPT_PGMCC_FEEDBACK_SIZE) {
|
2004-03-09 06:46:03 +00:00
|
|
|
proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb,
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_current_offset(cursor), 1, genopts_len,
|
|
|
|
"Length: %u (bogus, must be >= %u)",
|
|
|
|
genopts_len, PGM_OPT_PGMCC_FEEDBACK_SIZE);
|
2004-03-09 06:46:03 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_len, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_opx, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccfeedbk_res, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccfeedbk_tsp, 4, FALSE);
|
|
|
|
optdata_afi = tvb_get_ntohs(tvb, ptvcursor_current_offset(cursor));
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccfeedbk_afi, 2, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccfeedbk_lossrate, 2, FALSE);
|
2001-08-02 17:05:00 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
switch (optdata_afi) {
|
2001-08-02 17:05:00 +00:00
|
|
|
|
|
|
|
case AFNUM_INET:
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccfeedbk_acker, 4, FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AFNUM_INET6:
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_ccfeedbk_acker6, 16, FALSE);
|
2001-08-02 17:05:00 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2006-07-01 19:19:35 +00:00
|
|
|
proto_tree_add_text(opt_tree, tvb, ptvcursor_current_offset(cursor), -1,
|
|
|
|
"Can't handle this address format");
|
2001-08-02 17:05:00 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2003-03-12 04:04:15 +00:00
|
|
|
case PGM_OPT_NAK_BO_IVL:{
|
|
|
|
opt_tree = proto_item_add_subtree(tf, ett_pgm_opts_nak_bo_ivl);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opt_tree);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, FALSE);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_type, 1, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (genopts_len < PGM_OPT_NAK_BO_IVL_SIZE) {
|
2004-03-09 06:46:03 +00:00
|
|
|
proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb,
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_current_offset(cursor), 1, genopts_len,
|
|
|
|
"Length: %u (bogus, must be >= %u)",
|
|
|
|
genopts_len, PGM_OPT_NAK_BO_IVL_SIZE);
|
2004-03-09 06:46:03 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_len, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_opx, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_nak_bo_ivl_res, 1, FALSE);
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_nak_bo_ivl_bo_ivl, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_nak_bo_ivl_bo_ivl_sqn, 4, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PGM_OPT_NAK_BO_RNG:{
|
|
|
|
opt_tree = proto_item_add_subtree(tf, ett_pgm_opts_nak_bo_rng);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opt_tree);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, FALSE);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_type, 1, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (genopts_len < PGM_OPT_NAK_BO_RNG_SIZE) {
|
2004-03-09 06:46:03 +00:00
|
|
|
proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb,
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_current_offset(cursor), 1, genopts_len,
|
|
|
|
"Length: %u (bogus, must be >= %u)",
|
|
|
|
genopts_len, PGM_OPT_NAK_BO_RNG_SIZE);
|
2004-03-09 06:46:03 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_len, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_opx, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_nak_bo_rng_res, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_nak_bo_rng_min_bo_ivl, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_nak_bo_rng_max_bo_ivl, 4, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PGM_OPT_REDIRECT:{
|
2006-07-01 19:19:35 +00:00
|
|
|
guint16 optdata_afi;
|
2003-03-12 04:04:15 +00:00
|
|
|
|
|
|
|
opt_tree = proto_item_add_subtree(tf, ett_pgm_opts_redirect);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opt_tree);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, FALSE);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_type, 1, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (genopts_len < PGM_OPT_REDIRECT_SIZE) {
|
2004-03-09 06:46:03 +00:00
|
|
|
proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb,
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_current_offset(cursor), 1, genopts_len,
|
|
|
|
"Length: %u (bogus, must be >= %u)",
|
|
|
|
genopts_len, PGM_OPT_REDIRECT_SIZE);
|
2004-03-09 06:46:03 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_len, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_opx, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_redirect_res, 1, FALSE);
|
|
|
|
optdata_afi = tvb_get_ntohs(tvb, ptvcursor_current_offset(cursor));
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_redirect_afi, 2, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_redirect_res2, 2, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
switch (optdata_afi) {
|
2003-03-12 04:04:15 +00:00
|
|
|
|
|
|
|
case AFNUM_INET:
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_redirect_dlr, 4, FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AFNUM_INET6:
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_redirect_dlr6, 16, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2011-08-08 17:59:32 +00:00
|
|
|
proto_tree_add_text(opt_tree, tvb, ptvcursor_current_offset(cursor), -1,
|
2006-07-01 19:19:35 +00:00
|
|
|
"Can't handle this address format");
|
2003-03-12 04:04:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PGM_OPT_FRAGMENT:{
|
|
|
|
opt_tree = proto_item_add_subtree(tf, ett_pgm_opts_fragment);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opt_tree);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2010-05-27 21:54:58 +00:00
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, FALSE);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_type, 1, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (genopts_len < PGM_OPT_FRAGMENT_SIZE) {
|
2004-03-09 06:46:03 +00:00
|
|
|
proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb,
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_current_offset(cursor), 1, genopts_len,
|
|
|
|
"Length: %u (bogus, must be >= %u)",
|
|
|
|
genopts_len, PGM_OPT_FRAGMENT_SIZE);
|
2004-03-09 06:46:03 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_len, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_genopt_opx, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_fragment_res, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_fragment_first_sqn, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_fragment_offset, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_opt_fragment_total_length, 4, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
opts_total_len -= genopts_len;
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
return;
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
|
|
|
|
static const value_string type_vals[] = {
|
|
|
|
{ PGM_SPM_PCKT, "SPM" },
|
|
|
|
{ PGM_RDATA_PCKT, "RDATA" },
|
|
|
|
{ PGM_ODATA_PCKT, "ODATA" },
|
|
|
|
{ PGM_NAK_PCKT, "NAK" },
|
|
|
|
{ PGM_NNAK_PCKT, "NNAK" },
|
|
|
|
{ PGM_NCF_PCKT, "NCF" },
|
2003-03-12 04:04:15 +00:00
|
|
|
{ PGM_POLL_PCKT, "POLL" },
|
|
|
|
{ PGM_POLR_PCKT, "POLR" },
|
2001-08-02 17:05:00 +00:00
|
|
|
{ PGM_ACK_PCKT, "ACK" },
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
2003-03-12 04:04:15 +00:00
|
|
|
|
|
|
|
static const value_string poll_subtype_vals[] = {
|
|
|
|
{ PGM_POLL_GENERAL, "General" },
|
|
|
|
{ PGM_POLL_DLR, "DLR" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
2006-07-01 19:19:35 +00:00
|
|
|
|
2001-08-02 17:05:00 +00:00
|
|
|
/* Determine if there is a sub-dissector and call it. This has been */
|
|
|
|
/* separated into a stand alone routine to other protocol dissectors */
|
|
|
|
/* can call to it, ie. socks */
|
|
|
|
|
2005-08-02 04:31:42 +00:00
|
|
|
static void
|
2001-08-02 17:05:00 +00:00
|
|
|
decode_pgm_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
2006-07-01 19:19:35 +00:00
|
|
|
proto_tree *tree, guint16 pgmhdr_sport, guint16 pgmhdr_dport)
|
2001-08-02 17:05:00 +00:00
|
|
|
{
|
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
int found = 0;
|
|
|
|
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset);
|
2001-08-02 17:05:00 +00:00
|
|
|
|
|
|
|
/* do lookup with the subdissector table */
|
2010-12-20 05:35:29 +00:00
|
|
|
found = dissector_try_uint(subdissector_table, pgmhdr_sport,
|
2001-08-02 17:05:00 +00:00
|
|
|
next_tvb, pinfo, tree);
|
|
|
|
if (found)
|
|
|
|
return;
|
|
|
|
|
2010-12-20 05:35:29 +00:00
|
|
|
found = dissector_try_uint(subdissector_table, pgmhdr_dport,
|
2001-08-02 17:05:00 +00:00
|
|
|
next_tvb, pinfo, tree);
|
|
|
|
if (found)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* do lookup with the heuristic subdissector table */
|
|
|
|
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree))
|
2006-07-01 19:19:35 +00:00
|
|
|
return;
|
2001-08-02 17:05:00 +00:00
|
|
|
|
|
|
|
/* Oh, well, we don't know this; dissect it as data. */
|
2001-11-25 22:51:14 +00:00
|
|
|
call_dissector(data_handle,next_tvb, pinfo, tree);
|
2001-08-02 17:05:00 +00:00
|
|
|
}
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
|
2001-07-12 20:16:29 +00:00
|
|
|
/*
|
|
|
|
* dissect_pgm - The dissector for Pragmatic General Multicast
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
2006-07-01 19:19:35 +00:00
|
|
|
guint16 pgmhdr_sport;
|
|
|
|
guint16 pgmhdr_dport;
|
|
|
|
guint8 pgmhdr_type;
|
|
|
|
guint8 pgmhdr_opts;
|
|
|
|
guint16 pgmhdr_cksum;
|
|
|
|
guint16 pgmhdr_tsdulen;
|
|
|
|
guint32 sqn;
|
|
|
|
guint16 afi;
|
|
|
|
|
|
|
|
guint plen = 0;
|
2001-07-12 20:16:29 +00:00
|
|
|
proto_item *ti;
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
const char *pktname;
|
2003-03-12 04:04:15 +00:00
|
|
|
const char *pollstname;
|
2001-08-02 17:05:00 +00:00
|
|
|
char *gsi;
|
2006-07-01 19:19:35 +00:00
|
|
|
gboolean isdata = FALSE;
|
2003-03-12 04:04:15 +00:00
|
|
|
guint pgmlen, reportedlen;
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PGM");
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
2001-12-10 00:26:21 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2006-07-01 19:19:35 +00:00
|
|
|
if (tvb_reported_length_remaining(tvb, 0) < 18) {
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO,
|
|
|
|
"Packet too small");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
pinfo->srcport = pgmhdr_sport = tvb_get_ntohs(tvb, 0);
|
|
|
|
pinfo->destport = pgmhdr_dport = tvb_get_ntohs(tvb, 2);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
pgmhdr_type = tvb_get_guint8(tvb, 4);
|
|
|
|
pktname = val_to_str(pgmhdr_type, type_vals, "Unknown (0x%02x)");
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
pgmhdr_opts = tvb_get_guint8(tvb, 5);
|
|
|
|
pgmhdr_cksum = tvb_get_ntohs(tvb, 6);
|
|
|
|
gsi = tvb_bytes_to_str(tvb, 8, 6);
|
|
|
|
pgmhdr_tsdulen = tvb_get_ntohs(tvb, 14);
|
|
|
|
sqn = tvb_get_ntohl(tvb, 16);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
switch(pgmhdr_type) {
|
|
|
|
case PGM_SPM_PCKT:
|
2001-07-12 20:16:29 +00:00
|
|
|
case PGM_NAK_PCKT:
|
|
|
|
case PGM_NNAK_PCKT:
|
|
|
|
case PGM_NCF_PCKT:
|
2006-07-01 19:19:35 +00:00
|
|
|
case PGM_POLR_PCKT:
|
|
|
|
case PGM_ACK_PCKT:
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO,
|
2006-07-01 19:19:35 +00:00
|
|
|
"%-5s sqn 0x%x gsi %s", pktname, sqn, gsi);
|
2001-08-02 17:05:00 +00:00
|
|
|
}
|
|
|
|
break;
|
2006-07-01 19:19:35 +00:00
|
|
|
case PGM_RDATA_PCKT:
|
|
|
|
case PGM_ODATA_PCKT:
|
2003-03-12 04:04:15 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO,
|
2006-07-01 19:19:35 +00:00
|
|
|
"%-5s sqn 0x%x gsi %s tsdulen %d", pktname, sqn, gsi,
|
|
|
|
pgmhdr_tsdulen);
|
2003-03-12 04:04:15 +00:00
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
isdata = TRUE;
|
2003-03-12 04:04:15 +00:00
|
|
|
break;
|
2006-07-01 19:19:35 +00:00
|
|
|
case PGM_POLL_PCKT: {
|
|
|
|
guint16 poll_stype = tvb_get_ntohs(tvb, 22);
|
|
|
|
pollstname = val_to_str(poll_stype, poll_subtype_vals, "Unknown (0x%02x)");
|
|
|
|
|
2003-03-12 04:04:15 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO,
|
2011-08-08 17:59:32 +00:00
|
|
|
"%-5s sqn 0x%x gsi %s subtype %s",
|
2006-07-01 19:19:35 +00:00
|
|
|
pktname, sqn, gsi, pollstname);
|
2003-03-12 04:04:15 +00:00
|
|
|
}
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
}
|
2001-07-12 20:16:29 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
{
|
|
|
|
proto_tree *pgm_tree = NULL;
|
|
|
|
proto_tree *opt_tree = NULL;
|
|
|
|
proto_tree *type_tree = NULL;
|
2008-05-14 01:47:41 +00:00
|
|
|
proto_item *tf, *hidden_item;
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_t* cursor;
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_pgm,
|
2006-07-01 19:19:35 +00:00
|
|
|
tvb, 0, -1,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
"Pragmatic General Multicast: Type %s"
|
2006-07-01 19:19:35 +00:00
|
|
|
" Src Port %u, Dst Port %u, GSI %s", pktname,
|
|
|
|
pgmhdr_sport, pgmhdr_dport, gsi);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
|
|
|
pgm_tree = proto_item_add_subtree(ti, ett_pgm);
|
2006-07-01 19:19:35 +00:00
|
|
|
|
|
|
|
cursor = ptvcursor_new(pgm_tree, tvb, 0);
|
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
hidden_item = proto_tree_add_item(pgm_tree, hf_pgm_port, tvb, 0, 2, ENC_BIG_ENDIAN);
|
2008-05-14 01:47:41 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
2011-10-06 03:35:44 +00:00
|
|
|
hidden_item = proto_tree_add_item(pgm_tree, hf_pgm_port, tvb, 2, 2, ENC_BIG_ENDIAN);
|
2008-05-14 01:47:41 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_main_sport, 2, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_main_dport, 2, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_main_type, 1, FALSE);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
tf = proto_tree_add_uint_format(pgm_tree, hf_pgm_main_opts, tvb,
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_current_offset(cursor), 1, pgmhdr_opts, "Options: %s (0x%x)",
|
|
|
|
optsstr(pgmhdr_opts), pgmhdr_opts);
|
2001-07-12 20:16:29 +00:00
|
|
|
opt_tree = proto_item_add_subtree(tf, ett_pgm_optbits);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, opt_tree);
|
|
|
|
|
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_main_opts_opt, 1, FALSE);
|
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_main_opts_netsig, 1, FALSE);
|
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_main_opts_varlen, 1, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_main_opts_parity, 1, FALSE);
|
|
|
|
ptvcursor_set_tree(cursor, pgm_tree);
|
|
|
|
|
|
|
|
/* Checksum may be 0 (not available), but not for DATA packets */
|
2011-08-08 17:59:32 +00:00
|
|
|
if ((pgmhdr_type != PGM_RDATA_PCKT) && (pgmhdr_type != PGM_ODATA_PCKT) &&
|
2006-07-01 19:19:35 +00:00
|
|
|
(pgmhdr_cksum == 0))
|
|
|
|
{
|
|
|
|
proto_tree_add_uint_format(pgm_tree, hf_pgm_main_cksum, tvb,
|
|
|
|
ptvcursor_current_offset(cursor), 2, pgmhdr_cksum, "Checksum: not available");
|
|
|
|
} else {
|
|
|
|
reportedlen = tvb_reported_length(tvb);
|
|
|
|
pgmlen = tvb_length(tvb);
|
|
|
|
if (pgm_check_checksum && pgmlen >= reportedlen) {
|
|
|
|
vec_t cksum_vec[1];
|
|
|
|
guint16 computed_cksum;
|
|
|
|
|
|
|
|
cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, pgmlen);
|
|
|
|
cksum_vec[0].len = pgmlen;
|
|
|
|
computed_cksum = in_cksum(&cksum_vec[0], 1);
|
|
|
|
if (computed_cksum == 0) {
|
|
|
|
proto_tree_add_uint_format(pgm_tree, hf_pgm_main_cksum, tvb,
|
|
|
|
ptvcursor_current_offset(cursor), 2, pgmhdr_cksum, "Checksum: 0x%04x [correct]", pgmhdr_cksum);
|
|
|
|
} else {
|
2008-05-14 01:47:41 +00:00
|
|
|
hidden_item = proto_tree_add_boolean(pgm_tree, hf_pgm_main_cksum_bad, tvb,
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_current_offset(cursor), 2, TRUE);
|
2008-05-14 01:47:41 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
2006-07-01 19:19:35 +00:00
|
|
|
proto_tree_add_uint_format(pgm_tree, hf_pgm_main_cksum, tvb,
|
|
|
|
ptvcursor_current_offset(cursor), 2, pgmhdr_cksum, "Checksum: 0x%04x [incorrect, should be 0x%04x]",
|
|
|
|
pgmhdr_cksum, in_cksum_shouldbe(pgmhdr_cksum, computed_cksum));
|
|
|
|
}
|
2003-03-12 04:04:15 +00:00
|
|
|
} else {
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add_no_advance(cursor, hf_pgm_main_cksum, 2, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
}
|
|
|
|
}
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_advance(cursor, 2);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_main_gsi, 6, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_main_tsdulen, 2, FALSE);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
tf = proto_tree_add_text(pgm_tree, tvb, ptvcursor_current_offset(cursor), plen, "%s Packet", pktname);
|
|
|
|
switch(pgmhdr_type) {
|
2001-07-12 20:16:29 +00:00
|
|
|
case PGM_SPM_PCKT:
|
|
|
|
type_tree = proto_item_add_subtree(tf, ett_pgm_spm);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, type_tree);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_spm_sqn, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_spm_trail, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_spm_lead, 4, FALSE);
|
|
|
|
afi = tvb_get_ntohs(tvb, ptvcursor_current_offset(cursor));
|
|
|
|
ptvcursor_add(cursor, hf_pgm_spm_pathafi, 2, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_spm_res, 2, FALSE);
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
switch (afi) {
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
case AFNUM_INET:
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_spm_path, 4, FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AFNUM_INET6:
|
|
|
|
ptvcursor_add(cursor, hf_pgm_spm_path6, 16, FALSE);
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2011-08-08 17:59:32 +00:00
|
|
|
proto_tree_add_text(type_tree, tvb, ptvcursor_current_offset(cursor), -1,
|
2006-07-01 19:19:35 +00:00
|
|
|
"Can't handle this address format");
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
return;
|
|
|
|
}
|
2001-07-12 20:16:29 +00:00
|
|
|
break;
|
|
|
|
case PGM_RDATA_PCKT:
|
2006-07-01 19:19:35 +00:00
|
|
|
case PGM_ODATA_PCKT:
|
2001-07-12 20:16:29 +00:00
|
|
|
type_tree = proto_item_add_subtree(tf, ett_pgm_data);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, type_tree);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_spm_sqn, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_spm_trail, 4, FALSE);
|
2001-07-12 20:16:29 +00:00
|
|
|
break;
|
|
|
|
case PGM_NAK_PCKT:
|
|
|
|
case PGM_NNAK_PCKT:
|
|
|
|
case PGM_NCF_PCKT:
|
|
|
|
type_tree = proto_item_add_subtree(tf, ett_pgm_nak);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, type_tree);
|
2001-07-12 20:16:29 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_nak_sqn, 4, FALSE);
|
|
|
|
afi = tvb_get_ntohs(tvb, ptvcursor_current_offset(cursor));
|
|
|
|
ptvcursor_add(cursor, hf_pgm_nak_srcafi, 2, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_nak_srcres, 2, FALSE);
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
switch (afi) {
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
case AFNUM_INET:
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_nak_src, 4, FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AFNUM_INET6:
|
|
|
|
ptvcursor_add(cursor, hf_pgm_nak_src6, 16, FALSE);
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2011-08-08 17:59:32 +00:00
|
|
|
proto_tree_add_text(type_tree, tvb, ptvcursor_current_offset(cursor), -1,
|
2006-07-01 19:19:35 +00:00
|
|
|
"Can't handle this address format");
|
2001-08-02 17:05:00 +00:00
|
|
|
break;
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
}
|
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
afi = tvb_get_ntohs(tvb, ptvcursor_current_offset(cursor));
|
|
|
|
ptvcursor_add(cursor, hf_pgm_nak_grpafi, 2, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_nak_grpres, 2, FALSE);
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
switch (afi) {
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
case AFNUM_INET:
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_nak_grp, 4, FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AFNUM_INET6:
|
|
|
|
ptvcursor_add(cursor, hf_pgm_nak_grp6, 16, FALSE);
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2011-08-08 17:59:32 +00:00
|
|
|
proto_tree_add_text(type_tree, tvb, ptvcursor_current_offset(cursor), -1,
|
2006-07-01 19:19:35 +00:00
|
|
|
"Can't handle this address format");
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
return;
|
|
|
|
}
|
2003-03-12 04:04:15 +00:00
|
|
|
break;
|
|
|
|
case PGM_POLL_PCKT:
|
|
|
|
type_tree = proto_item_add_subtree(tf, ett_pgm_poll);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, type_tree);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_poll_sqn, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_poll_round, 2, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_poll_subtype, 2, FALSE);
|
|
|
|
afi = tvb_get_ntohs(tvb, ptvcursor_current_offset(cursor));
|
|
|
|
ptvcursor_add(cursor, hf_pgm_poll_pathafi, 2, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_poll_res, 2, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
switch (afi) {
|
2003-03-12 04:04:15 +00:00
|
|
|
case AFNUM_INET:
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_poll_path, 4, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
break;
|
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
case AFNUM_INET6:
|
|
|
|
ptvcursor_add(cursor, hf_pgm_poll_path6, 16, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
break;
|
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
default:
|
2011-08-08 17:59:32 +00:00
|
|
|
proto_tree_add_text(type_tree, tvb, ptvcursor_current_offset(cursor), -1,
|
2006-07-01 19:19:35 +00:00
|
|
|
"Can't handle this address format");
|
2003-03-12 04:04:15 +00:00
|
|
|
break;
|
2006-07-01 19:19:35 +00:00
|
|
|
}
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_poll_backoff_ivl, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_poll_rand_str, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_poll_matching_bmask, 4, FALSE);
|
2003-03-12 04:04:15 +00:00
|
|
|
break;
|
|
|
|
case PGM_POLR_PCKT:
|
|
|
|
type_tree = proto_item_add_subtree(tf, ett_pgm_polr);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, type_tree);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_polr_sqn, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_polr_round, 2, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_polr_res, 2, FALSE);
|
2001-08-02 17:05:00 +00:00
|
|
|
break;
|
|
|
|
case PGM_ACK_PCKT:
|
|
|
|
type_tree = proto_item_add_subtree(tf, ett_pgm_ack);
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_set_tree(cursor, type_tree);
|
2001-08-02 17:05:00 +00:00
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
ptvcursor_add(cursor, hf_pgm_ack_sqn, 4, FALSE);
|
|
|
|
ptvcursor_add(cursor, hf_pgm_ack_bitmap, 4, FALSE);
|
2001-07-12 20:16:29 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2006-07-01 19:19:35 +00:00
|
|
|
if (pgmhdr_opts & PGM_OPT)
|
|
|
|
dissect_pgmopts(cursor, pktname);
|
|
|
|
|
2011-08-08 17:59:32 +00:00
|
|
|
if (isdata)
|
2006-07-01 19:19:35 +00:00
|
|
|
decode_pgm_ports(tvb, ptvcursor_current_offset(cursor), pinfo, tree, pgmhdr_sport, pgmhdr_dport);
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Register all the bits needed with the filtering engine */
|
2002-08-28 21:04:11 +00:00
|
|
|
void
|
2001-07-12 20:16:29 +00:00
|
|
|
proto_register_pgm(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_pgm_main_sport,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Source Port", "pgm.hdr.sport", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_main_dport,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Destination Port", "pgm.hdr.dport", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2004-12-26 00:22:16 +00:00
|
|
|
{ &hf_pgm_port,
|
|
|
|
{ "Port", "pgm.port", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_main_type,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Type", "pgm.hdr.type", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(type_vals), 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_main_opts,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Options", "pgm.hdr.opts", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_main_opts_opt,
|
2006-07-01 19:19:35 +00:00
|
|
|
{ "Options", "pgm.hdr.opts.opt", FT_BOOLEAN, 8,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
TFS(&opts_present), PGM_OPT, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_main_opts_netsig,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Network Significant Options", "pgm.hdr.opts.netsig",
|
2006-07-01 19:19:35 +00:00
|
|
|
FT_BOOLEAN, 8,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
TFS(&opts_present), PGM_OPT_NETSIG, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_main_opts_varlen,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Variable length Parity Packet Option", "pgm.hdr.opts.varlen",
|
2006-07-01 19:19:35 +00:00
|
|
|
FT_BOOLEAN, 8,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
TFS(&opts_present), PGM_OPT_VAR_PKTLEN, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_main_opts_parity,
|
2006-07-01 19:19:35 +00:00
|
|
|
{ "Parity", "pgm.hdr.opts.parity", FT_BOOLEAN, 8,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
TFS(&opts_present), PGM_OPT_PARITY, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_main_cksum,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Checksum", "pgm.hdr.cksum", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_main_cksum_bad,
|
|
|
|
{ "Bad Checksum", "pgm.hdr.cksum_bad", FT_BOOLEAN, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_main_gsi,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Global Source Identifier", "pgm.hdr.gsi", FT_BYTES, BASE_NONE,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_main_tsdulen,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Transport Service Data Unit Length", "pgm.hdr.tsdulen", FT_UINT16,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_spm_sqn,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Sequence number", "pgm.spm.sqn", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_spm_trail,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Trailing Edge Sequence Number", "pgm.spm.trail", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_spm_lead,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Leading Edge Sequence Number", "pgm.spm.lead", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_spm_pathafi,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Path NLA AFI", "pgm.spm.pathafi", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(afn_vals), 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_spm_res,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Reserved", "pgm.spm.res", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_spm_path,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Path NLA", "pgm.spm.path", FT_IPv4, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2006-07-01 19:19:35 +00:00
|
|
|
{ &hf_pgm_spm_path6,
|
|
|
|
{ "Path NLA", "pgm.spm.path", FT_IPv6, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_data_sqn,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Data Packet Sequence Number", "pgm.data.sqn", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_data_trail,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Trailing Edge Sequence Number", "pgm.data.trail", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_nak_sqn,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Requested Sequence Number", "pgm.nak.sqn", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_nak_srcafi,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Source NLA AFI", "pgm.nak.srcafi", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(afn_vals), 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_nak_srcres,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Reserved", "pgm.nak.srcres", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_nak_src,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Source NLA", "pgm.nak.src", FT_IPv4, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2006-07-01 19:19:35 +00:00
|
|
|
{ &hf_pgm_nak_src6,
|
|
|
|
{ "Source NLA", "pgm.nak.src", FT_IPv6, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ &hf_pgm_nak_grpafi,
|
|
|
|
{ "Multicast Group AFI", "pgm.nak.grpafi", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(afn_vals), 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_nak_grpres,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Reserved", "pgm.nak.grpres", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_nak_grp,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Multicast Group NLA", "pgm.nak.grp", FT_IPv4, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2006-07-01 19:19:35 +00:00
|
|
|
{ &hf_pgm_nak_grp6,
|
|
|
|
{ "Multicast Group NLA", "pgm.nak.grp", FT_IPv6, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_poll_sqn,
|
|
|
|
{ "Sequence Number", "pgm.poll.sqn", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_poll_round,
|
|
|
|
{ "Round", "pgm.poll.round", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_poll_subtype,
|
|
|
|
{ "Subtype", "pgm.poll.subtype", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(poll_subtype_vals), 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_poll_pathafi,
|
|
|
|
{ "Path NLA AFI", "pgm.poll.pathafi", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(afn_vals), 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_poll_res,
|
|
|
|
{ "Reserved", "pgm.poll.res", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_poll_path,
|
|
|
|
{ "Path NLA", "pgm.poll.path", FT_IPv4, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2006-07-01 19:19:35 +00:00
|
|
|
{ &hf_pgm_poll_path6,
|
|
|
|
{ "Path NLA", "pgm.poll.path", FT_IPv6, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_poll_backoff_ivl,
|
|
|
|
{ "Back-off Interval", "pgm.poll.backoff_ivl", FT_UINT32, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_poll_rand_str,
|
|
|
|
{ "Random String", "pgm.poll.rand_str", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_poll_matching_bmask,
|
|
|
|
{ "Matching Bitmask", "pgm.poll.matching_bmask", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_polr_sqn,
|
|
|
|
{ "Sequence Number", "pgm.polr.sqn", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_polr_round,
|
|
|
|
{ "Round", "pgm.polr.round", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_polr_res,
|
|
|
|
{ "Reserved", "pgm.polr.res", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_ack_sqn,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Maximum Received Sequence Number", "pgm.ack.maxsqn", FT_UINT32,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
BASE_HEX, NULL, 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_ack_bitmap,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Packet Bitmap", "pgm.ack.bitmap", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_opt_type,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Type", "pgm.opts.type", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(opt_vals), 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_opt_len,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Length", "pgm.opts.len", FT_UINT8, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_opt_tlen,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Total Length", "pgm.opts.tlen", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2010-05-27 21:54:58 +00:00
|
|
|
{ &hf_pgm_genopt_end,
|
|
|
|
{ "Option end", "pgm.genopts.end", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_yes_no), 0x80, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_genopt_type,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Type", "pgm.genopts.type", FT_UINT8, BASE_HEX,
|
2010-05-27 21:54:58 +00:00
|
|
|
VALS(opt_vals), 0x7f, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_genopt_len,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Length", "pgm.genopts.len", FT_UINT8, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_genopt_opx,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Option Extensibility Bits", "pgm.genopts.opx", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(opx_vals), 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_opt_parity_prm_po,
|
2001-08-02 17:05:00 +00:00
|
|
|
{ "Parity Parameters", "pgm.opts.parity_prm.op", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_opt_parity_prm_prmtgsz,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Transmission Group Size", "pgm.opts.parity_prm.prm_grp",
|
|
|
|
FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_opt_join_res,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Reserved", "pgm.opts.join.res", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_opt_join_minjoin,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Minimum Sequence Number", "pgm.opts.join.min_join",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_opt_parity_grp_res,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Reserved", "pgm.opts.parity_prm.op", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_opt_parity_grp_prmgrp,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Transmission Group Size", "pgm.opts.parity_prm.prm_grp",
|
|
|
|
FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_opt_nak_res,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "Reserved", "pgm.opts.nak.op", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-07-12 20:16:29 +00:00
|
|
|
{ &hf_pgm_opt_nak_list,
|
There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.
Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".
Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings. Use
"bytes_to_str()" to turn byte arrays into strings of hex digits. Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global. Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant). Put the
type, length, and total length of the options into the protocol tree as
separate fields. Don't have separate type, length, and OPX fields for
every type of option; one field will suffice. Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for). Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with. Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.
svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
|
|
|
{ "List", "pgm.opts.nak.list", FT_BYTES, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_opt_ccdata_res,
|
|
|
|
{ "Reserved", "pgm.opts.ccdata.res", FT_UINT8, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_opt_ccdata_tsp,
|
|
|
|
{ "Time Stamp", "pgm.opts.ccdata.tstamp", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_opt_ccdata_afi,
|
|
|
|
{ "Acker AFI", "pgm.opts.ccdata.afi", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(afn_vals), 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_opt_ccdata_res2,
|
|
|
|
{ "Reserved", "pgm.opts.ccdata.res2", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_opt_ccdata_acker,
|
|
|
|
{ "Acker", "pgm.opts.ccdata.acker", FT_IPv4, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2006-07-01 19:19:35 +00:00
|
|
|
{ &hf_pgm_opt_ccdata_acker6,
|
|
|
|
{ "Acker", "pgm.opts.ccdata.acker", FT_IPv6, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_opt_ccfeedbk_res,
|
|
|
|
{ "Reserved", "pgm.opts.ccdata.res", FT_UINT8, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_opt_ccfeedbk_tsp,
|
|
|
|
{ "Time Stamp", "pgm.opts.ccdata.tstamp", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_opt_ccfeedbk_afi,
|
|
|
|
{ "Acker AFI", "pgm.opts.ccdata.afi", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(afn_vals), 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_opt_ccfeedbk_lossrate,
|
|
|
|
{ "Loss Rate", "pgm.opts.ccdata.lossrate", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2001-08-02 17:05:00 +00:00
|
|
|
{ &hf_pgm_opt_ccfeedbk_acker,
|
|
|
|
{ "Acker", "pgm.opts.ccdata.acker", FT_IPv4, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2006-07-01 19:19:35 +00:00
|
|
|
{ &hf_pgm_opt_ccfeedbk_acker6,
|
|
|
|
{ "Acker", "pgm.opts.ccdata.acker", FT_IPv6, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_nak_bo_ivl_res,
|
|
|
|
{ "Reserved", "pgm.opts.nak_bo_ivl.res", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_nak_bo_ivl_bo_ivl,
|
|
|
|
{ "Back-off Interval", "pgm.opts.nak_bo_ivl.bo_ivl", FT_UINT32, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_nak_bo_ivl_bo_ivl_sqn,
|
|
|
|
{ "Back-off Interval Sequence Number", "pgm.opts.nak_bo_ivl.bo_ivl_sqn", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_nak_bo_rng_res,
|
|
|
|
{ "Reserved", "pgm.opts.nak_bo_rng.res", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_nak_bo_rng_min_bo_ivl,
|
|
|
|
{ "Min Back-off Interval", "pgm.opts.nak_bo_rng.min_bo_ivl", FT_UINT32, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_nak_bo_rng_max_bo_ivl,
|
|
|
|
{ "Max Back-off Interval", "pgm.opts.nak_bo_rng.max_bo_ivl", FT_UINT32, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_redirect_res,
|
|
|
|
{ "Reserved", "pgm.opts.redirect.res", FT_UINT8, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_redirect_afi,
|
|
|
|
{ "DLR AFI", "pgm.opts.redirect.afi", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(afn_vals), 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_redirect_res2,
|
|
|
|
{ "Reserved", "pgm.opts.redirect.res2", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_redirect_dlr,
|
|
|
|
{ "DLR", "pgm.opts.redirect.dlr", FT_IPv4, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2006-07-01 19:19:35 +00:00
|
|
|
{ &hf_pgm_opt_redirect_dlr6,
|
|
|
|
{ "DLR", "pgm.opts.redirect.dlr", FT_IPv6, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_fragment_res,
|
|
|
|
{ "Reserved", "pgm.opts.fragment.res", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_fragment_first_sqn,
|
|
|
|
{ "First Sequence Number", "pgm.opts.fragment.first_sqn", FT_UINT32, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-12-19 22:46:16 +00:00
|
|
|
{ &hf_pgm_opt_fragment_offset,
|
|
|
|
{ "Fragment Offset", "pgm.opts.fragment.fragment_offset", FT_UINT32, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-03-12 04:04:15 +00:00
|
|
|
{ &hf_pgm_opt_fragment_total_length,
|
|
|
|
{ "Total Length", "pgm.opts.fragment.total_length", FT_UINT32, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }}
|
2001-07-12 20:16:29 +00:00
|
|
|
};
|
|
|
|
static gint *ett[] = {
|
2006-07-01 19:19:35 +00:00
|
|
|
&ett_pgm,
|
2001-07-12 20:16:29 +00:00
|
|
|
&ett_pgm_optbits,
|
|
|
|
&ett_pgm_spm,
|
|
|
|
&ett_pgm_data,
|
|
|
|
&ett_pgm_nak,
|
2003-03-12 04:04:15 +00:00
|
|
|
&ett_pgm_poll,
|
|
|
|
&ett_pgm_polr,
|
2001-08-02 17:05:00 +00:00
|
|
|
&ett_pgm_ack,
|
2001-07-12 20:16:29 +00:00
|
|
|
&ett_pgm_opts,
|
|
|
|
&ett_pgm_opts_join,
|
|
|
|
&ett_pgm_opts_parityprm,
|
|
|
|
&ett_pgm_opts_paritygrp,
|
|
|
|
&ett_pgm_opts_naklist,
|
2001-08-02 17:05:00 +00:00
|
|
|
&ett_pgm_opts_ccdata,
|
2003-03-12 04:04:15 +00:00
|
|
|
&ett_pgm_opts_nak_bo_ivl,
|
|
|
|
&ett_pgm_opts_nak_bo_rng,
|
|
|
|
&ett_pgm_opts_redirect,
|
2006-07-01 19:19:35 +00:00
|
|
|
&ett_pgm_opts_fragment
|
2001-07-12 20:16:29 +00:00
|
|
|
};
|
2001-08-06 19:05:14 +00:00
|
|
|
module_t *pgm_module;
|
2001-07-12 20:16:29 +00:00
|
|
|
|
|
|
|
proto_pgm = proto_register_protocol("Pragmatic General Multicast",
|
|
|
|
"PGM", "pgm");
|
|
|
|
|
|
|
|
proto_register_field_array(proto_pgm, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
2001-08-02 17:05:00 +00:00
|
|
|
/* subdissector code */
|
2001-12-08 06:41:48 +00:00
|
|
|
subdissector_table = register_dissector_table("pgm.port",
|
|
|
|
"PGM port", FT_UINT16, BASE_DEC);
|
2001-08-02 17:05:00 +00:00
|
|
|
register_heur_dissector_list("pgm", &heur_subdissector_list);
|
|
|
|
|
2001-08-06 19:05:14 +00:00
|
|
|
/*
|
|
|
|
* Register configuration preferences for UDP encapsulation
|
2008-09-15 18:58:03 +00:00
|
|
|
* (Note: Initially the ports are set to zero and the ports
|
2011-08-08 17:59:32 +00:00
|
|
|
* are not registered so the dissecting of PGM
|
2008-09-15 18:58:03 +00:00
|
|
|
* encapsulated in UDP packets is off by default;
|
|
|
|
* dissector_add_handle is called so that pgm
|
|
|
|
* is available for 'decode-as'
|
2001-08-06 19:05:14 +00:00
|
|
|
*/
|
2008-09-15 18:58:03 +00:00
|
|
|
pgm_module = prefs_register_protocol(proto_pgm, proto_reg_handoff_pgm);
|
2001-08-06 19:05:14 +00:00
|
|
|
|
2008-09-15 18:58:03 +00:00
|
|
|
prefs_register_bool_preference(pgm_module, "check_checksum",
|
|
|
|
"Check the validity of the PGM checksum when possible",
|
2003-03-12 04:04:15 +00:00
|
|
|
"Whether to check the validity of the PGM checksum",
|
2008-09-15 18:58:03 +00:00
|
|
|
&pgm_check_checksum);
|
2003-03-12 04:04:15 +00:00
|
|
|
|
2008-09-15 18:58:03 +00:00
|
|
|
prefs_register_uint_preference(pgm_module, "udp.encap_ucast_port",
|
2002-08-28 21:04:11 +00:00
|
|
|
"PGM Encap Unicast Port (standard is 3055)",
|
2001-08-06 19:05:14 +00:00
|
|
|
"PGM Encap is PGM packets encapsulated in UDP packets"
|
2002-08-28 21:04:11 +00:00
|
|
|
" (Note: This option is off, i.e. port is 0, by default)",
|
2001-08-06 19:05:14 +00:00
|
|
|
10, &udp_encap_ucast_port);
|
|
|
|
|
2008-09-15 18:58:03 +00:00
|
|
|
prefs_register_uint_preference(pgm_module, "udp.encap_mcast_port",
|
2002-08-28 21:04:11 +00:00
|
|
|
"PGM Encap Multicast Port (standard is 3056)",
|
2001-08-06 19:05:14 +00:00
|
|
|
"PGM Encap is PGM packets encapsulated in UDP packets"
|
2002-08-28 21:04:11 +00:00
|
|
|
" (Note: This option is off, i.e. port is 0, by default)",
|
2001-08-06 19:05:14 +00:00
|
|
|
10, &udp_encap_mcast_port);
|
|
|
|
|
2001-07-12 20:16:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* The registration hand-off routine */
|
2008-09-15 18:58:03 +00:00
|
|
|
/*
|
|
|
|
* Set up PGM Encap dissecting, which is off by default for UDP
|
|
|
|
*/
|
|
|
|
|
2001-07-12 20:16:29 +00:00
|
|
|
void
|
|
|
|
proto_reg_handoff_pgm(void)
|
|
|
|
{
|
2008-09-15 19:03:03 +00:00
|
|
|
static gboolean initialized = FALSE;
|
2008-09-15 18:58:03 +00:00
|
|
|
static dissector_handle_t pgm_handle;
|
|
|
|
static guint old_udp_encap_ucast_port;
|
|
|
|
static guint old_udp_encap_mcast_port;
|
|
|
|
|
|
|
|
if (! initialized) {
|
|
|
|
pgm_handle = create_dissector_handle(dissect_pgm, proto_pgm);
|
|
|
|
dissector_add_handle("udp.port", pgm_handle); /* for 'decode-as' */
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ip.proto", IP_PROTO_PGM, pgm_handle);
|
2008-09-15 18:58:03 +00:00
|
|
|
data_handle = find_dissector("data");
|
|
|
|
initialized = TRUE;
|
|
|
|
} else {
|
|
|
|
if (old_udp_encap_ucast_port != 0) {
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_delete_uint("udp.port", old_udp_encap_ucast_port, pgm_handle);
|
2008-09-15 18:58:03 +00:00
|
|
|
}
|
|
|
|
if (old_udp_encap_mcast_port != 0) {
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_delete_uint("udp.port", old_udp_encap_mcast_port, pgm_handle);
|
2008-09-15 18:58:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (udp_encap_ucast_port != 0) {
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("udp.port", udp_encap_ucast_port, pgm_handle);
|
2008-09-15 18:58:03 +00:00
|
|
|
}
|
|
|
|
if (udp_encap_mcast_port != 0) {
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("udp.port", udp_encap_mcast_port, pgm_handle);
|
2008-09-15 18:58:03 +00:00
|
|
|
}
|
|
|
|
old_udp_encap_ucast_port = udp_encap_ucast_port;
|
|
|
|
old_udp_encap_mcast_port = udp_encap_mcast_port;
|
2001-08-06 19:05:14 +00:00
|
|
|
}
|