diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2018-02-07 20:20:36 +0100 |
---|---|---|
committer | Mohsin Kazmi <sykazmi@cisco.com> | 2018-02-13 11:16:32 +0100 |
commit | 49c7f0ca1770304183a8bdfa23a5df751a056401 (patch) | |
tree | e53504d422f02b07e1b6b8aa4dd713decb6b6b14 /src/vpp-api/vom/types.cpp | |
parent | 26f341a8392d73735d7f341d7e947150966eeb6b (diff) |
VOM: ACL: Add Object Model for acl ethertype
Change-Id: I2b572ebd4b7bb26381f127912a4cc0825c04fc34
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/types.cpp')
-rw-r--r-- | src/vpp-api/vom/types.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/vpp-api/vom/types.cpp b/src/vpp-api/vom/types.cpp index 4f8884615e2..82f0aec20b2 100644 --- a/src/vpp-api/vom/types.cpp +++ b/src/vpp-api/vom/types.cpp @@ -274,6 +274,55 @@ operator<<(std::ostream& os, const direction_t& dir) return os; } +const ethertype_t ethertype_t::ARP(0x0806, "arp"); +const ethertype_t ethertype_t::FCOE(0x8906, "fcoe"); +const ethertype_t ethertype_t::IPV4(0x0800, "ipv4"); +const ethertype_t ethertype_t::IPV6(0x86DD, "ipv6"); +const ethertype_t ethertype_t::MAC_SECURITY(0x88E5, "mac-security"); +const ethertype_t ethertype_t::MPLS_UNICAST(0x8847, "mpls-unicast"); +const ethertype_t ethertype_t::TRILL(0x22F3, "trill"); +const ethertype_t ethertype_t::UNSPECIFIED(0x0, "unspecified"); + +ethertype_t::ethertype_t(int v, const std::string s) + : enum_base(v, s) +{ +} + +std::ostream& +operator<<(std::ostream& os, const ethertype_t& ether) +{ + os << ether.to_string(); + return os; +} + +const ethertype_t& +ethertype_t::from_numeric_val(uint16_t numeric) +{ + if (0x0806 == numeric) { + return (ethertype_t::ARP); + } + if (0x8906 == numeric) { + return (ethertype_t::FCOE); + } + if (0x0800 == numeric) { + return (ethertype_t::IPV4); + } + if (0x86DD == numeric) { + return (ethertype_t::IPV6); + } + if (0x88E5 == numeric) { + return (ethertype_t::MAC_SECURITY); + } + if (0x8847 == numeric) { + return (ethertype_t::MPLS_UNICAST); + } + if (0x22F3 == numeric) { + return (ethertype_t::TRILL); + } + + return (ethertype_t::UNSPECIFIED); +} + }; // namespace VOM /* |