forked from osmocom/wireshark
Make some routines static that aren't used outside this module.
Use "guint16" instead of "u_int16_t", "guint8" instead of "u_int8_t", and "guint" instead of "u_int", to handle platforms lacking the latter types. Make "ppp_heuristic_guess()" reeturn a Boolean, as it just returns a "yes or no" answer. svn path=/trunk/; revision=13132
This commit is contained in:
parent
c4c4dd4715
commit
b799112fdd
|
@ -83,8 +83,8 @@ static dissector_table_t osinl_subdissector_table;
|
||||||
static dissector_table_t osinl_excl_subdissector_table;
|
static dissector_table_t osinl_excl_subdissector_table;
|
||||||
|
|
||||||
static void dissect_juniper_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 atm_pictype);
|
static void dissect_juniper_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 atm_pictype);
|
||||||
u_int ppp_heuristic_guess(guint16);
|
static gboolean ppp_heuristic_guess(guint16 proto);
|
||||||
u_int ip_heuristic_guess(guint8);
|
static guint ip_heuristic_guess(guint8 ip_header_byte);
|
||||||
|
|
||||||
/* wrapper for passing the PIC type to the generic ATM dissector */
|
/* wrapper for passing the PIC type to the generic ATM dissector */
|
||||||
static void
|
static void
|
||||||
|
@ -254,7 +254,7 @@ dissect_juniper_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16
|
||||||
|
|
||||||
proto = tvb_get_ntohs(tvb, offset); /* second try: 16-Bit guess */
|
proto = tvb_get_ntohs(tvb, offset); /* second try: 16-Bit guess */
|
||||||
|
|
||||||
if ( ppp_heuristic_guess(proto) != 0 &&
|
if ( ppp_heuristic_guess(proto) &&
|
||||||
atm_pictype != JUNIPER_ATM1) { /* VC-MUX PPPoA encaps ? - not supported on ATM1 PICs */
|
atm_pictype != JUNIPER_ATM1) { /* VC-MUX PPPoA encaps ? - not supported on ATM1 PICs */
|
||||||
ti = proto_tree_add_text (tree, tvb, offset, 2, "Payload Type: VC-MUX PPP");
|
ti = proto_tree_add_text (tree, tvb, offset, 2, "Payload Type: VC-MUX PPP");
|
||||||
subtree = proto_item_add_subtree(ti, ett_juniper);
|
subtree = proto_item_add_subtree(ti, ett_juniper);
|
||||||
|
@ -298,8 +298,8 @@ dissect_juniper_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16
|
||||||
}
|
}
|
||||||
|
|
||||||
/* list of Juniper supported PPP proto IDs */
|
/* list of Juniper supported PPP proto IDs */
|
||||||
u_int
|
static gboolean
|
||||||
ppp_heuristic_guess(const u_int16_t proto) {
|
ppp_heuristic_guess(guint16 proto) {
|
||||||
|
|
||||||
switch(proto) {
|
switch(proto) {
|
||||||
case PPP_IP :
|
case PPP_IP :
|
||||||
|
@ -315,11 +315,11 @@ ppp_heuristic_guess(const u_int16_t proto) {
|
||||||
case PPP_MP :
|
case PPP_MP :
|
||||||
case PPP_IPV6 :
|
case PPP_IPV6 :
|
||||||
case PPP_IPV6CP :
|
case PPP_IPV6CP :
|
||||||
return 1;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0; /* did not find a ppp header */
|
return FALSE; /* did not find a ppp header */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -328,8 +328,8 @@ ppp_heuristic_guess(const u_int16_t proto) {
|
||||||
* return the IP version number based on the first byte of the IP header
|
* return the IP version number based on the first byte of the IP header
|
||||||
* returns 0 if it does not match a valid first IPv4/IPv6 header byte
|
* returns 0 if it does not match a valid first IPv4/IPv6 header byte
|
||||||
*/
|
*/
|
||||||
u_int
|
static guint
|
||||||
ip_heuristic_guess(const u_int8_t ip_header_byte) {
|
ip_heuristic_guess(guint8 ip_header_byte) {
|
||||||
|
|
||||||
switch(ip_header_byte) {
|
switch(ip_header_byte) {
|
||||||
case 0x45:
|
case 0x45:
|
||||||
|
|
Loading…
Reference in New Issue