blob: 40356d309ef6766cbe0157274f37b4036fac4631 [file] [log] [blame]
Takahiro Suzukid7bf8202020-12-17 20:21:59 +09001/*
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
17package l2oam
18
19import (
20 "github.com/google/gopacket"
21)
22
23// GenerateGenericActionCreateDs generates "Generic/Action Create" message
24func GenerateGenericActionCreateDs() gopacket.SerializableLayer {
25
26 tibitData := &setGenericActionCreateReq{
27 // IEEE 1904.2
28 Opcode: 0x03,
29 // OMI Protocol
30 Flags: 0x0050,
31 OAMPDUCode: 0xfe,
32 OUId: []byte{0x2a, 0xea, 0x15},
33 // TiBiT OLT Management Interface
34 TOMIOpcode: 0x03,
35 // Correlation Tag
36 CTBranch: 0x0c,
37 CTType: 0x0c7a,
38 CTLength: 4,
39 CTInstance: getOltInstance(),
40 // Object Context
41 OCBranch: 0x0c,
42 OCType: 0x0dce,
43 OCLength: 4,
44 OCInstance: 0x00000000,
45 //Vc
46 VcBranch: 0x6e,
47 VcLeaf: 0x7001,
48 VcLength: 4,
49 //OT
50 OT: []OTGenericActionCreate{{OTLength: 3, OTValue: []byte{0x0c, 0x02, 0x5d}}},
51 // End
52 EndBranch: 0,
53 }
54
55 return tibitData
56
57}