2 ==================================================================================
3 Copyright (c) 2019 AT&T Intellectual Property.
4 Copyright (c) 2019 Nokia
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ==================================================================================
25 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
30 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 type RmrDatagram struct {
39 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
42 type SubRouteInfo struct {
49 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
52 type RmrEndpoint struct {
53 Addr string // xapp addr
54 Port uint16 // xapp port
57 func (endpoint RmrEndpoint) String() string {
61 func (endpoint *RmrEndpoint) GetAddr() string {
65 func (endpoint *RmrEndpoint) GetPort() uint16 {
69 func (endpoint *RmrEndpoint) Get() string {
70 return endpoint.Addr + ":" + strconv.FormatUint(uint64(endpoint.Port), 10)
73 func (endpoint *RmrEndpoint) Set(src string) bool {
74 elems := strings.Split(src, ":")
77 srcPort, err := strconv.ParseUint(elems[1], 10, 16)
79 endpoint.Addr = srcAddr
80 endpoint.Port = uint16(srcPort)
87 func NewRmrEndpoint(src string) *RmrEndpoint {
89 if ep.Set(src) == false {
95 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
100 func (act Action) String() string {
101 actions := [...]string{
108 if act < CREATE || act > DELETE {
114 //-----------------------------------------------------------------------------
115 // To add own method for rmrparams
116 //-----------------------------------------------------------------------------
117 type RMRParams struct {
121 func (params *RMRParams) String() string {
123 fmt.Fprintf(&b, "Src=%s Mtype=%s(%d) SubId=%v Xid=%s Meid=%v", params.Src, xapp.RicMessageTypeToName[params.Mtype], params.Mtype, params.SubId, params.Xid, params.Meid)