Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 1 | /* |
Joey Armstrong | 14628cd | 2023-01-10 08:38:31 -0500 | [diff] [blame^] | 2 | * Copyright 2018-2023 Open Networking Foundation (ONF) and the ONF Contributors |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package packetHandlers |
| 18 | |
| 19 | type PacketType int |
| 20 | |
| 21 | const ( |
| 22 | UNKNOWN PacketType = iota |
| 23 | EAPOL |
| 24 | DHCP |
Matteo Scandolo | 618a658 | 2020-09-09 12:21:29 -0700 | [diff] [blame] | 25 | IGMP |
Matteo Scandolo | ec170af | 2021-10-07 11:53:22 -0700 | [diff] [blame] | 26 | ICMP |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 27 | ) |
| 28 | |
| 29 | func (t PacketType) String() string { |
| 30 | names := [...]string{ |
| 31 | "UNKNOWN", |
| 32 | "EAPOL", |
| 33 | "DHCP", |
Matteo Scandolo | 618a658 | 2020-09-09 12:21:29 -0700 | [diff] [blame] | 34 | "IGMP", |
Matteo Scandolo | ec170af | 2021-10-07 11:53:22 -0700 | [diff] [blame] | 35 | "ICMP", |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 36 | } |
| 37 | return names[t] |
| 38 | } |