aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cosine.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2012-04-24 18:27:06 +0000
committerBill Meier <wmeier@newsguy.com>2012-04-24 18:27:06 +0000
commit1ec161eab8217893d5526be86b7d0e8c4d4fe597 (patch)
tree1bae58bc30d7e70b07e2a3c4d333e903460bf60c /epan/dissectors/packet-cosine.c
parent53738a1695f45dbea18fb5f1846bb71ecc135509 (diff)
Minor cleanup: whitespace, indentation, long-lines, style, typos, etc;
Also: remove unneeded #include <stdlib.h> in 2 cases. svn path=/trunk/; revision=42226
Diffstat (limited to 'epan/dissectors/packet-cosine.c')
-rw-r--r--epan/dissectors/packet-cosine.c128
1 files changed, 64 insertions, 64 deletions
diff --git a/epan/dissectors/packet-cosine.c b/epan/dissectors/packet-cosine.c
index dffd46ef63..ddc0e1ae7e 100644
--- a/epan/dissectors/packet-cosine.c
+++ b/epan/dissectors/packet-cosine.c
@@ -55,9 +55,9 @@ static dissector_handle_t data_handle;
static void
dissect_cosine(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- proto_tree *fh_tree;
- proto_item *ti;
- union wtap_pseudo_header *pseudo_header = pinfo->pseudo_header;
+ proto_tree *fh_tree;
+ proto_item *ti;
+ union wtap_pseudo_header *pseudo_header = pinfo->pseudo_header;
/* load the top pane info. This should be overwritten by
the next protocol in the stack */
@@ -70,8 +70,8 @@ dissect_cosine(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
layer (ie none) */
if(tree) {
ti = proto_tree_add_protocol_format(tree, proto_cosine, tvb, 0, 0,
- "CoSine IPNOS L2 debug output (%s)",
- pseudo_header->cosine.if_name);
+ "CoSine IPNOS L2 debug output (%s)",
+ pseudo_header->cosine.if_name);
fh_tree = proto_item_add_subtree(ti, ett_raw);
proto_tree_add_uint(fh_tree, hf_pro, tvb, 0, 0, pseudo_header->cosine.pro);
proto_tree_add_uint(fh_tree, hf_off, tvb, 0, 0, pseudo_header->cosine.off);
@@ -80,65 +80,65 @@ dissect_cosine(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(fh_tree, hf_err, tvb, 0, 0, pseudo_header->cosine.err);
switch (pseudo_header->cosine.encap) {
+ case COSINE_ENCAP_ETH:
+ break;
+ case COSINE_ENCAP_ATM:
+ case COSINE_ENCAP_PPoATM:
+ proto_tree_add_text(fh_tree, tvb, 0, 16, "SAR header");
+ break;
+ case COSINE_ENCAP_PPP:
+ case COSINE_ENCAP_FR:
+ case COSINE_ENCAP_PPoFR:
+ proto_tree_add_text(fh_tree, tvb, 0, 4, "Channel handle ID");
+ break;
+ case COSINE_ENCAP_HDLC:
+ if (pseudo_header->cosine.direction == COSINE_DIR_TX) {
+ proto_tree_add_text(fh_tree, tvb, 0, 2,
+ "Channel handle ID");
+ } else if (pseudo_header->cosine.direction == COSINE_DIR_RX) {
+ proto_tree_add_text(fh_tree, tvb, 0, 4,
+ "Channel handle ID");
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ switch (pseudo_header->cosine.encap) {
case COSINE_ENCAP_ETH:
- break;
+ call_dissector(eth_withoutfcs_handle, tvb_new_subset_remaining(tvb, 0),
+ pinfo, tree);
+ break;
case COSINE_ENCAP_ATM:
case COSINE_ENCAP_PPoATM:
- proto_tree_add_text(fh_tree, tvb, 0, 16, "SAR header");
- break;
+ call_dissector(llc_handle, tvb_new_subset_remaining(tvb, 16),
+ pinfo, tree);
+ break;
case COSINE_ENCAP_PPP:
+ call_dissector(ppp_hdlc_handle, tvb_new_subset_remaining(tvb, 4),
+ pinfo, tree);
+ break;
+ case COSINE_ENCAP_HDLC:
+ if (pseudo_header->cosine.direction == COSINE_DIR_TX) {
+ call_dissector(chdlc_handle, tvb_new_subset_remaining(tvb, 2),
+ pinfo, tree);
+ } else if (pseudo_header->cosine.direction == COSINE_DIR_RX) {
+ call_dissector(chdlc_handle, tvb_new_subset_remaining(tvb, 4),
+ pinfo, tree);
+ }
+ break;
case COSINE_ENCAP_FR:
case COSINE_ENCAP_PPoFR:
- proto_tree_add_text(fh_tree, tvb, 0, 4, "Channel handle ID");
- break;
- case COSINE_ENCAP_HDLC:
- if (pseudo_header->cosine.direction == COSINE_DIR_TX) {
- proto_tree_add_text(fh_tree, tvb, 0, 2,
- "Channel handle ID");
- } else if (pseudo_header->cosine.direction == COSINE_DIR_RX) {
- proto_tree_add_text(fh_tree, tvb, 0, 4,
- "Channel handle ID");
- }
- break;
+ call_dissector(fr_handle, tvb_new_subset_remaining(tvb, 4),
+ pinfo, tree);
+ break;
+ case COSINE_ENCAP_TEST:
+ case COSINE_ENCAP_UNKNOWN:
+ call_dissector(data_handle, tvb, pinfo, tree);
+ break;
default:
- break;
- }
- }
-
- switch (pseudo_header->cosine.encap) {
- case COSINE_ENCAP_ETH:
- call_dissector(eth_withoutfcs_handle, tvb_new_subset_remaining(tvb, 0),
- pinfo, tree);
- break;
- case COSINE_ENCAP_ATM:
- case COSINE_ENCAP_PPoATM:
- call_dissector(llc_handle, tvb_new_subset_remaining(tvb, 16),
- pinfo, tree);
- break;
- case COSINE_ENCAP_PPP:
- call_dissector(ppp_hdlc_handle, tvb_new_subset_remaining(tvb, 4),
- pinfo, tree);
- break;
- case COSINE_ENCAP_HDLC:
- if (pseudo_header->cosine.direction == COSINE_DIR_TX) {
- call_dissector(chdlc_handle, tvb_new_subset_remaining(tvb, 2),
- pinfo, tree);
- } else if (pseudo_header->cosine.direction == COSINE_DIR_RX) {
- call_dissector(chdlc_handle, tvb_new_subset_remaining(tvb, 4),
- pinfo, tree);
- }
- break;
- case COSINE_ENCAP_FR:
- case COSINE_ENCAP_PPoFR:
- call_dissector(fr_handle, tvb_new_subset_remaining(tvb, 4),
- pinfo, tree);
- break;
- case COSINE_ENCAP_TEST:
- case COSINE_ENCAP_UNKNOWN:
- call_dissector(data_handle, tvb, pinfo, tree);
- break;
- default:
- break;
+ break;
}
}
@@ -153,7 +153,7 @@ proto_register_cosine(void)
{ &hf_pri,
{ "Priority", "cosine.pri", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_rm,
- { "Rate Marking", "cosine.rm", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ { "Rate Marking", "cosine.rm", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_err,
{ "Error Code", "cosine.err", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
};
@@ -163,7 +163,7 @@ proto_register_cosine(void)
};
proto_cosine = proto_register_protocol("CoSine IPNOS L2 debug output",
- "CoSine", "cosine");
+ "CoSine", "cosine");
proto_register_field_array(proto_cosine, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
@@ -177,11 +177,11 @@ proto_reg_handoff_cosine(void)
* Get handles for dissectors.
*/
eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
- ppp_hdlc_handle = find_dissector("ppp_hdlc");
- llc_handle = find_dissector("llc");
- chdlc_handle = find_dissector("chdlc");
- fr_handle = find_dissector("fr");
- data_handle = find_dissector("data");
+ ppp_hdlc_handle = find_dissector("ppp_hdlc");
+ llc_handle = find_dissector("llc");
+ chdlc_handle = find_dissector("chdlc");
+ fr_handle = find_dissector("fr");
+ data_handle = find_dissector("data");
cosine_handle = create_dissector_handle(dissect_cosine, proto_cosine);
dissector_add_uint("wtap_encap", WTAP_ENCAP_COSINE, cosine_handle);