Takahiro Suzuki | d7bf820 | 2020-12-17 20:21:59 +0900 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2020-present Open Networking Foundation |
| 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 l2oam |
| 18 | |
| 19 | import ( |
| 20 | "github.com/google/gopacket" |
| 21 | ) |
| 22 | |
| 23 | // GenerateSetManagementLock generates "Device/ManagementLock" message |
| 24 | func GenerateSetManagementLock() gopacket.SerializableLayer { |
| 25 | tibitData := &TOAMSetRequest{ |
| 26 | // IEEE 1904.2 |
| 27 | Opcode: 0x03, |
| 28 | // OAM Protocol |
| 29 | Flags: 0x0050, |
| 30 | OAMPDUCode: 0xfe, |
| 31 | OUId: []byte{0x2a, 0xea, 0x15}, |
| 32 | // TiBit OLT Management Interface |
| 33 | TOMIOpcode: 0x03, |
| 34 | // Correlation Tag |
| 35 | CTBranch: 0x0c, |
| 36 | CTType: 0x0c7a, |
| 37 | CTLength: 4, |
| 38 | CTInstance: getOltInstance(), |
| 39 | // Object Context |
| 40 | OCBranch: 0x0c, |
| 41 | OCType: 0x0dce, |
| 42 | OCLength: 4, |
| 43 | OCInstance: 0x00000000, |
| 44 | // Vc |
| 45 | VcBranch: 0xde, |
| 46 | VcLeaf: 0x002e, |
| 47 | VcLength: 0x04, |
| 48 | // EC |
| 49 | ECLength: 1, |
| 50 | ECValue: []byte{0x00}, |
| 51 | ECList: []ECValueSet{ |
| 52 | { |
| 53 | Length: 0x01, |
| 54 | Value: []byte{0x02}, |
| 55 | }, |
| 56 | }, |
| 57 | // End |
| 58 | EndBranch: 0x00, |
| 59 | } |
| 60 | return tibitData |
| 61 | } |