Rich Lane | 64585d9 | 2013-10-02 16:01:37 -0700 | [diff] [blame] | 1 | # Copyright 2013, Big Switch Networks, Inc. |
| 2 | # |
| 3 | # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with |
| 4 | # the following special exception: |
| 5 | # |
| 6 | # LOXI Exception |
| 7 | # |
| 8 | # As a special exception to the terms of the EPL, you may distribute libraries |
| 9 | # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided |
| 10 | # that copyright and licensing notices generated by LoxiGen are not altered or removed |
| 11 | # from the LoxiGen Libraries and the notice provided below is (i) included in |
| 12 | # the LoxiGen Libraries, if distributed in source code form and (ii) included in any |
| 13 | # documentation for the LoxiGen Libraries, if distributed in binary form. |
| 14 | # |
| 15 | # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler." |
| 16 | # |
| 17 | # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain |
| 18 | # a copy of the EPL at: |
| 19 | # |
| 20 | # http://www.eclipse.org/legal/epl-v10.html |
| 21 | # |
| 22 | # Unless required by applicable law or agreed to in writing, software |
| 23 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 24 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 25 | # EPL for the specific language governing permissions and limitations |
| 26 | # under the EPL. |
| 27 | |
| 28 | # Map from LOXI types to Wireshark types |
| 29 | oftype_to_wireshark_type = { |
Rich Lane | 4df40f3 | 2013-10-08 15:40:39 -0700 | [diff] [blame^] | 30 | "char": "int8", |
| 31 | "uint8_t": "uint8", |
| 32 | "uint16_t": "uint16", |
| 33 | "uint32_t": "uint32", |
| 34 | "uint64_t": "uint64", |
| 35 | "of_mac_addr_t": "ether", |
| 36 | "of_ipv4_t": "ipv4", |
| 37 | "of_ipv6_t": "ipv6", |
| 38 | "of_port_name_t": "stringz", |
| 39 | "of_table_name_t": "stringz", |
| 40 | "of_desc_str_t": "stringz", |
| 41 | "of_serial_num_t": "stringz", |
| 42 | "of_octets_t": "bytes", |
| 43 | "of_port_no_t": "uint32", |
| 44 | "of_port_desc_t": "stringz", |
| 45 | "of_bsn_vport_t": "bytes", |
| 46 | "of_bsn_vport_q_in_q_t": "bytes", |
| 47 | "of_fm_cmd_t": "uint16", |
| 48 | "of_wc_bmap_t": "uint64", |
| 49 | "of_match_bmap_t": "uint64", |
| 50 | "of_match_t": "bytes", |
| 51 | "of_oxm_t": "bytes", |
| 52 | "of_meter_features_t": "bytes", |
Rich Lane | 64585d9 | 2013-10-02 16:01:37 -0700 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | # Map from LOXI type to Wireshark base |
| 56 | oftype_to_base = { |
| 57 | "char": "DEC", |
| 58 | "uint8_t": "DEC", |
| 59 | "uint16_t": "DEC", |
| 60 | "uint32_t": "DEC", |
| 61 | "uint64_t": "DEC", |
| 62 | "of_mac_addr_t": "NONE", |
| 63 | "of_ipv4_t": "NONE", |
| 64 | "of_ipv6_t": "NONE", |
| 65 | "of_port_name_t": "NONE", |
| 66 | "of_table_name_t": "NONE", |
| 67 | "of_desc_str_t": "NONE", |
| 68 | "of_serial_num_t": "NONE", |
| 69 | "of_octets_t": "NONE", |
| 70 | "of_port_no_t": "DEC", |
| 71 | "of_port_desc_t": "NONE", |
| 72 | "of_bsn_vport_t": "NONE", |
| 73 | "of_bsn_vport_q_in_q_t": "NONE", |
| 74 | "of_fm_cmd_t": "DEC", |
| 75 | "of_wc_bmap_t": "HEX", |
| 76 | "of_match_bmap_t": "HEX", |
| 77 | "of_match_t": "NONE", |
| 78 | "of_oxm_t": "NONE", |
| 79 | "of_meter_features_t": "NONE", |
| 80 | } |
| 81 | |
| 82 | # Override oftype_to_base for certain field names |
| 83 | field_to_base = { |
| 84 | "eth_type": "HEX", |
| 85 | "cookie": "HEX", |
| 86 | "datapath_id": "HEX", |
| 87 | } |