Chidambar babu | 86b3b1a | 2016-02-16 17:39:52 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Chidambar babu | 86b3b1a | 2016-02-16 17:39:52 +0530 | [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 | */ |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 16 | package org.onosproject.ospf.controller; |
Chidambar babu | 86b3b1a | 2016-02-16 17:39:52 +0530 | [diff] [blame] | 17 | |
| 18 | /** |
| 19 | * Representation of different OSPF packet types. |
| 20 | */ |
| 21 | public enum OspfPacketType { |
| 22 | |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 23 | /** |
| 24 | * OSPF hello packet. |
| 25 | */ |
Chidambar babu | 86b3b1a | 2016-02-16 17:39:52 +0530 | [diff] [blame] | 26 | HELLO(1), |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 27 | /** |
| 28 | * OSPF device description packet. |
| 29 | */ |
Chidambar babu | 86b3b1a | 2016-02-16 17:39:52 +0530 | [diff] [blame] | 30 | DD(2), |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 31 | /** |
| 32 | * OSPF link state request packet. |
| 33 | */ |
Chidambar babu | 86b3b1a | 2016-02-16 17:39:52 +0530 | [diff] [blame] | 34 | LSREQUEST(3), |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 35 | /** |
| 36 | * OSPF link state update packet. |
| 37 | */ |
Chidambar babu | 86b3b1a | 2016-02-16 17:39:52 +0530 | [diff] [blame] | 38 | LSUPDATE(4), |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 39 | /** |
| 40 | * OSPF link state acknowledge packet. |
| 41 | */ |
Chidambar babu | 86b3b1a | 2016-02-16 17:39:52 +0530 | [diff] [blame] | 42 | LSAACK(5); |
| 43 | |
| 44 | private int value; |
| 45 | |
| 46 | /** |
| 47 | * Creates instance of OSPF packet types. |
| 48 | * |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 49 | * @param value OSPF packet types |
Chidambar babu | 86b3b1a | 2016-02-16 17:39:52 +0530 | [diff] [blame] | 50 | */ |
| 51 | OspfPacketType(int value) { |
| 52 | this.value = value; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Gets the value. |
| 57 | * |
| 58 | * @return value |
| 59 | */ |
| 60 | public int value() { |
| 61 | return value; |
| 62 | } |
| 63 | } |