Wireshark-bugs: [Wireshark-bugs] [Bug 7145] Add L2TP filter on Control Message AVP value
Date: Wed, 18 Apr 2012 20:04:51 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7145

--- Comment #1 from Andy Karch <akk142@xxxxxxxxx> 2012-04-18 20:04:50 PDT ---
I have a few questions while posting the diff for this bug.

    - The original strings were based on the 'calltypestr' array in
epan/dissectors/packets-l2tp.c.  Is it normal to have the '_' and '-' in the
name like this?  It might look better if just spaces are used.  Even then, I'm
not sure it would be OK to change the name here due to anyone expected these
strings in the output.

    - Now that Message Type is a filter, these same strings from 'calltpyestr'
are visible in the filter expression menu.  These strings look a little long
and might look better with the short names as seen in 'calltype_short_str'.  Is
there a way to use 1 value_string array for displaying the field and another
for the filter expression menu?  Both arrays would need to be converted to
value_string.  I've copied what I've coded-up for a replacement of
'calltypestr' below.

Please let me know what you think.

Thanks,
-Andy
akarch@xxxxxxxxx




static const char *calltypestr[NUM_CONTROL_CALL_TYPES+1] = {
  "Unknown Call Type",
  "Start_Control_Request",
  "Start_Control_Reply",
  "Start_Control_Connected",
  "Stop_Control_Notification",
  "Reserved",                                                   /* 5*/
  "Hello",
  "Outgoing_Call_Request",
  "Outgoing_Call_Reply",
  "Outgoing_Call_Connected",
  "Incoming_Call_Request",                              /* 10 */
  "Incoming_Call_Reply",
  "Incoming_Call_Connected",
  "Reserved",                                                   /* 13 */
  "Call_Disconnect_Notification",
  "WAN_Error_Notify",                                   /* 15 */
  "Set_Link_Info",
  "Modem_Status",
  "Service_Relay_Request_Msg",
  "Service_Relay_Reply_Message",
  "Explicit_Acknowledgement",                   /* 20 */
  "Failover_Session_Query_Message",             /* 21 [RFC4951] */
  "Failover_Session_Response_Message",  /* 22 [RFC4951] */
  /* Multicast Management */
  "Multicast-Session-Request",                  /* 23 [RFC4045]*/
  "Multicast-Session-Response ",                /* 24 [RFC4045]*/
  "Multicast-Session-Establishment",    /* 25 [RFC4045]*/
  "Multicast-Session-Information",              /* 26 [RFC4045]*/
  "Multicast-Session-End-Notify",               /* 27 [RFC4045]*/
};


static const char *calltype_short_str[NUM_CONTROL_CALL_TYPES+1] = {
  "Unknown ",
  "SCCRQ   ",
  "SCCRP   ",
  "SCCCN   ",
  "StopCCN ",
  "Reserved", /* 5 */
  "Hello   ",
  "OCRQ    ",
  "OCRP    ",
  "OCCN    ",
  "ICRQ    ", /* 10 */
  "ICRP    ",
  "ICCN    ",
  "Reserved",
  "CDN     ",
  "WEN     ", /* 15 */
  "SLI     ",
  "MDMST   ",
  "SRRQ    ",
  "SRRP    ",
  "ACK     ", /* 20 */
  "FSQ     ",
  "FSR     ",
  "MSRQ    ",
  "MSRP    ",
  "MSE     ", /* 25 */
  "MSI     ",
  "MSEN    ",
};





#define MESSAGE_TYPE_SCCRQ      1
#define MESSAGE_TYPE_SCCRP      2
#define MESSAGE_TYPE_SCCCN      3
#define MESSAGE_TYPE_StopCCN    4

#define MESSAGE_TYPE_HELLO      6
#define MESSAGE_TYPE_OCRQ       7
#define MESSAGE_TYPE_OCRP       8
#define MESSAGE_TYPE_OCCN       9
#define MESSAGE_TYPE_ICRQ       10
#define MESSAGE_TYPE_ICRP       11
#define MESSAGE_TYPE_ICCN       12

#define MESSAGE_TYPE_CDN        14
#define MESSAGE_TYPE_WEN        15
#define MESSAGE_TYPE_SLI        16
#define MESSAGE_TYPE_MDMST      17
#define MESSAGE_TYPE_SRRQ       18
#define MESSAGE_TYPE_SRRP       19
#define MESSAGE_TYPE_ACK        20
#define MESSAGE_TYPE_FSQ        21
#define MESSAGE_TYPE_FSR        22
#define MESSAGE_TYPE_MSRQ       23
#define MESSAGE_TYPE_MSRP       24
#define MESSAGE_TYPE_MSE        25
#define MESSAGE_TYPE_MSI        26
#define MESSAGE_TYPE_MSEN       27


static const value_string message_type_vals[] = {
    { MESSAGE_TYPE_SCCRQ,       "Start_Control_Request" },
    { MESSAGE_TYPE_SCCRP,       "Start_Control_Reply" },
    { MESSAGE_TYPE_SCCCN,       "Start_Control_Connected" },
    { MESSAGE_TYPE_StopCCN,     "Stop_Control_Notification" },
    { MESSAGE_TYPE_HELLO,       "Hello" },
    { MESSAGE_TYPE_OCRQ,        "Outgoing_Call_Request" },
    { MESSAGE_TYPE_OCRP,        "Outgoing_Call_Reply" },
    { MESSAGE_TYPE_OCCN,        "Outgoing_Call_Connected" },
    { MESSAGE_TYPE_ICRQ,        "Incoming_Call_Request" },
    { MESSAGE_TYPE_ICRP,        "Incoming_Call_Reply" },
    { MESSAGE_TYPE_ICCN,        "Incoming_Call_Connected" },
    { MESSAGE_TYPE_CDN,         "Call_Disconnect_Notification" },
    { MESSAGE_TYPE_WEN,         "WAN_Error_Notify" },
    { MESSAGE_TYPE_SLI,         "Set_Link_Info" },
    { MESSAGE_TYPE_MDMST,       "Modem_Status" },
    { MESSAGE_TYPE_SRRQ,        "Service_Relay_Request_Msg" },
    { MESSAGE_TYPE_SRRP,        "Service_Relay_Reply_Message" },
    { MESSAGE_TYPE_ACK,         "Explicit_Acknowledgement" },
    /* Fail Over Extensions - RFC4951 */
    { MESSAGE_TYPE_FSQ,         "Failover_Session_Query_Message" },
    { MESSAGE_TYPE_FSR,         "Failover_Session_Response_Message" },
    /* Multicast Management - RFC4045 */
    { MESSAGE_TYPE_MSRQ,        "Multicast-Session-Request" },
    { MESSAGE_TYPE_MSRP,        "Multicast-Session-Response" },
    { MESSAGE_TYPE_MSE,         "Multicast-Session-Establishment" },
    { MESSAGE_TYPE_MSI,         "Multicast-Session-Information" },
    { MESSAGE_TYPE_MSEN,        "Multicast-Session-End-Notify" },
    { 0,                        NULL },
};

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.