2 * Routines for IPOS dissection
3 * Copyright 2015, Chuan He <chuan.he@ericsson.com>
4 * Anders Broman <anders.broman@ericsson.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
14 * This is a dissector for Ericsson IPOS Linux kernel packets' header
15 * exchanged between kernel and linecard. All fields are in network byte order.
16 * This header follow the Linux cooked-mode capture(SLL) and will call REDBACK
19 * IPOS is the network operating system running on a few Ericsson platforms
20 * including SSR 8000 routers, Router 6000 series, and SP routers.
22 * Product details for Ericsson's IP Metro and Backhaul routers using IPOS:
23 * http://www.ericsson.com/ourportfolio/products/ip-metro-and-backhaul
27 #include <epan/packet.h>
28 #include <epan/expert.h>
30 void proto_reg_handoff_ipos(void);
31 void proto_register_ipos(void);
33 static dissector_handle_t ipos_handle
;
34 static dissector_handle_t redback_handle
;
36 static int proto_ipos
;
37 static int hf_ipos_protocol
;
38 static int hf_ipos_priority
;
39 static int hf_ipos_ppe
;
40 static int hf_ipos_slot
;
43 /* static expert_field ei_ipos_protocol; */
45 #define LINUX_SLL_P_IPOS_NETIPC 0x0030 /* IPOS IPC frames to/from AF_IPC module */
46 #define LINUX_SLL_P_IPOS_RBN 0x0031 /* IPOS IP frames to/from CTX module */
47 #define LINUX_SLL_P_IPOS_NETLINK 0x0032 /* IPOS data frames to/from AF_RBN_NETLINK module */
48 #define LINUX_SLL_P_IPOS_XCRP 0x0033 /* IPOS data frames to/from XCRP driver */
49 #define LINUX_SLL_P_IPOS_ISIS 0x0034 /* IPOS data frames to/from ISIS module */
50 #define LINUX_SLL_P_IPOS_PAKIO 0x0035 /* IPOS data frames to/from AF_RBN_PAKIO module */
52 static const value_string prototypenames
[] = {
55 { 2, "Control (IPC) message" },
57 { 4, "PAKIO packet" },
61 static const value_string ppetypenames
[] = {
69 * Dissect a buffer containing IPOS kernel packet bit string.
71 * @param tvb The buffer to dissect.
72 * @param pinfo Packet Info.
73 * @param tree The protocol tree.
76 dissect_ipos(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
78 proto_item
*ti
= NULL
;
79 proto_tree
*ipos_tree
= NULL
;
83 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "IPOS");
84 col_clear(pinfo
->cinfo
, COL_INFO
);
86 ti
= proto_tree_add_item(tree
, proto_ipos
, tvb
, 0, -1, ENC_NA
);
87 ipos_tree
= proto_item_add_subtree(ti
, ett_ipos
);
88 proto_tree_add_item(ipos_tree
, hf_ipos_protocol
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
89 proto_tree_add_item(ipos_tree
, hf_ipos_priority
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
91 proto_tree_add_item(ipos_tree
, hf_ipos_ppe
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
93 proto_tree_add_item(ipos_tree
, hf_ipos_slot
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
97 next_tvb
= tvb_new_subset_remaining(tvb
, offset
);
98 call_dissector(redback_handle
, next_tvb
, pinfo
, tree
);
101 return tvb_reported_length(tvb
);
105 proto_register_ipos(void)
107 static hf_register_info hf
[] = {
109 { "Protocol", "ipos.proto", FT_UINT8
, BASE_DEC
, VALS(prototypenames
), 0xF0,
113 { "Priority", "ipos.priority", FT_UINT8
, BASE_DEC
, NULL
, 0x0F,
117 { "Packet Processing Engine", "ipos.ppe", FT_UINT8
, BASE_HEX
, VALS(ppetypenames
), 0x0,
121 { "Destination (source) Slot", "ipos.slot", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
125 static int *ett
[] = {
130 static ei_register_info ei
[] = {
132 { "ipos.protocol.unknown", PI_PROTOCOL
, PI_WARN
,
133 "Unknown Protocol Data", EXPFILL
}}
136 expert_module_t
* expert_ipos
;
139 proto_ipos
= proto_register_protocol("IPOS Kernel Packet Protocol", "IPOS", "ipos");
140 proto_register_field_array(proto_ipos
, hf
, array_length(hf
));
141 proto_register_subtree_array(ett
, array_length(ett
));
143 expert_ipos
= expert_register_protocol(proto_ipos
);
144 expert_register_field_array(expert_ipos
, ei
, array_length(ei
));
146 ipos_handle
= register_dissector("ipos", dissect_ipos
, proto_ipos
);
150 proto_reg_handoff_ipos(void)
152 redback_handle
= find_dissector_add_dependency("redback", proto_ipos
);
154 /*dissector_add_uint("wtap_encap", WTAP_ENCAP_IPOS, ipos_handle); */
155 dissector_add_uint("sll.ltype", LINUX_SLL_P_IPOS_NETIPC
, ipos_handle
);
156 dissector_add_uint("sll.ltype", LINUX_SLL_P_IPOS_RBN
, ipos_handle
);
157 dissector_add_uint("sll.ltype", LINUX_SLL_P_IPOS_NETLINK
, ipos_handle
);
158 dissector_add_uint("sll.ltype", LINUX_SLL_P_IPOS_XCRP
, ipos_handle
);
159 dissector_add_uint("sll.ltype", LINUX_SLL_P_IPOS_ISIS
, ipos_handle
);
160 dissector_add_uint("sll.ltype", LINUX_SLL_P_IPOS_PAKIO
, ipos_handle
);
162 dissector_add_for_decode_as("ethertype", ipos_handle
);
166 * Editor modelines - https://www.wireshark.org/tools/modelines.html
171 * indent-tabs-mode: nil
174 * vi: set shiftwidth=4 tabstop=8 expandtab:
175 * :indentSize=4:tabSize=8:noTabs=true: