blob: 7112c7dcdfbd6d62ca883d565f5b89a1f63fa0f3 [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// GeneratePonpOptTxOutputPower generates "Ponp Optical Tx Output Power" message
24func GeneratePonpOptTxOutputPower(PkgType string) gopacket.SerializableLayer {
25
26 if PkgType == OnuPkgTypeA {
27 //TypeA
28 data := &TibitFrame{
29 Data: []byte{
30 0x03, 0x00, 0x50, 0xFE, 0x00, 0x10, 0x00, 0x01,
31 0xD6, 0x00, 0x01, 0x01, 0x00, 0xD7, 0x02, 0x20,
32 0x00, 0x00,
33 },
34 }
35 return data
36 } else if PkgType == OnuPkgTypeB {
37 //TypeB
38 data := &TibitFrame{
39 Data: []byte{
40 0x03, 0x00, 0x50, 0xfe, 0x90, 0x82, 0x60, 0x00,
41 0xca, 0xfe, 0x00, 0xb6, 0x00, 0x01, 0x04, 0x01,
42 0x00, 0x00, 0x01, 0xb7, 0x00, 0x33, 0x00, 0x00,
43 },
44 }
45
46 return data
47 }
48
49 return nil
50}