blob: a27086e73c5742f5f41fc19aa0e6358b80a95ae4 [file] [log] [blame]
Matteo Scandolo40e067f2019-10-16 16:59:41 -07001/*
Joey Armstrong2c039362024-02-04 18:51:52 -05002 * Copyright 2018-2024 Open Networking Foundation (ONF) and the ONF Contributors
Matteo Scandolo40e067f2019-10-16 16:59:41 -07003
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
17package packetHandlers
18
19type PacketType int
20
21const (
22 UNKNOWN PacketType = iota
23 EAPOL
24 DHCP
Matteo Scandolo618a6582020-09-09 12:21:29 -070025 IGMP
Matteo Scandoloec170af2021-10-07 11:53:22 -070026 ICMP
Matteo Scandolo40e067f2019-10-16 16:59:41 -070027)
28
29func (t PacketType) String() string {
30 names := [...]string{
31 "UNKNOWN",
32 "EAPOL",
33 "DHCP",
Matteo Scandolo618a6582020-09-09 12:21:29 -070034 "IGMP",
Matteo Scandoloec170af2021-10-07 11:53:22 -070035 "ICMP",
Matteo Scandolo40e067f2019-10-16 16:59:41 -070036 }
37 return names[t]
38}