RIC:1060: Change in PTL
[ric-plt/rtmgr.git] / pkg / rtmgr / types.go
index 0fa9dd1..f9a356c 100644 (file)
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
+
+   This source code is part of the near-RT RIC (RAN Intelligent Controller)
+   platform project (RICP).
+
 ==================================================================================
 */
 /*
   Mnemonic:    rtmgr/types.go
 ==================================================================================
 */
 /*
   Mnemonic:    rtmgr/types.go
-  Abstract:    Containes RTMGR (Routing Manager) specific types
+  Abstract:    Contains RTMGR (Routing Manager) specific types
   Date:                12 March 2019
 */
 
 package rtmgr
 
   Date:                12 March 2019
 */
 
 package rtmgr
 
-type Endpoint struct {
-       Name     string
-       Type     string
-       IpSocket string
-}
+type RMRUpdateType int
+
+const (
+       XappType = iota
+       SubsType
+       E2Type
+)
 
 type XApps struct {
 
 type XApps struct {
-       XApplist []XApp
+       XAppList []XApp
 }
 
 type RouteTable []RouteTableEntry
 }
 
 type RouteTable []RouteTableEntry
-
 type EndpointList []Endpoint
 
 type EndpointList []Endpoint
 
+type Endpoints map[string]*Endpoint
+
+type SubscriptionList []Subscription
+
+type MessageTypeList map[string]string
+
+type ProcessMultipleRMR map[string]int
+
+//TODO: uuid is not a real UUID but a string of "ip:port"
+// this should be changed to real UUID later on which should come from xApp Manager // petszila
+type Endpoint struct {
+       Uuid       string
+       Name       string
+       XAppType   string
+       Ip         string
+       Port       uint16
+       TxMessages []string
+       RxMessages []string
+       Policies   []int32
+       Socket     interface{}
+       IsReady    bool
+       Keepalive  bool
+       Whid       int
+}
+
 type RouteTableEntry struct {
        MessageType string
        TxList      EndpointList
        RxGroups    []EndpointList
 type RouteTableEntry struct {
        MessageType string
        TxList      EndpointList
        RxGroups    []EndpointList
+       SubID       int32
+       RouteType   string
 }
 
 type XApp struct {
 }
 
 type XApp struct {
@@ -55,7 +87,75 @@ type XAppInstance struct {
        Name       string   `json:"name"`
        Status     string   `json:"status"`
        Ip         string   `json:"ip"`
        Name       string   `json:"name"`
        Status     string   `json:"status"`
        Ip         string   `json:"ip"`
-       Port       int      `json:"port"`
+       Port       uint16   `json:"port"`
        TxMessages []string `json:"txMessages"`
        RxMessages []string `json:"rxMessages"`
        TxMessages []string `json:"txMessages"`
        RxMessages []string `json:"rxMessages"`
+       Policies   []int32  `json:"policies"`
+}
+
+type PlatformComponents []struct {
+       Name string `json:"name"`
+       Fqdn string `json:"fqdn"`
+       Port uint16 `json:"port"`
+}
+
+type E2TInstance struct {
+       Name    string   `json:"name"`
+       Fqdn    string   `json:"fqdn"`
+       Ranlist []string `json:"ranlist"`
+}
+
+type E2tIdentity struct {
+       E2taddress string   `json:"e2tAddress"`
+       Rannames   []string `json:"ranNames"`
 }
 }
+
+type ConfigRtmgr struct {
+       Pcs PlatformComponents `json:"PlatformComponents"`
+}
+
+type MessageTypeIdentifier struct {
+       Mit []string `json:"messagetypes"`
+}
+
+type RicComponents struct {
+       XApps   []XApp
+       E2Ts    map[string]E2TInstance
+       MeidMap []string
+       Pcs     PlatformComponents
+}
+
+type Subscription struct {
+       SubID int32
+       Fqdn  string
+       Port  uint16
+}
+
+type PlatformRoutes []struct {
+       MessageType    string `json:"messagetype"`
+       SenderEndPoint string `json:"senderendpoint"`
+       SubscriptionId int32  `json:"subscriptionid"`
+       EndPoint       string `json:"endpoint"`
+       Meid           string `json:"meid"`
+}
+
+type RtmgrRoutes struct {
+       Prs PlatformRoutes `json:"PlatformRoutes"`
+}
+
+type FqDn struct {
+       Address *string
+       Port    *uint16
+}
+
+type XappList struct {
+       SubscriptionID uint16
+       FqdnList       []FqDn
+}
+
+var (
+       Rtmgr_ready bool
+)
+
+//To encapsulate routing-manager's keys under their own namespace in a DB
+const RTMGR_SDL_NS string = "rtmgr"