Commit 273f5f77 authored by Yann Garcia's avatar Yann Garcia
Browse files

Update PC5 info support in meep-vis; Remove useless file; Bug fixed in meep-tc-sidecar Dockerfile

parent 8789f4bd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ COPY ./api /api
COPY ./user-api /user-api
COPY ./data /

RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list

RUN apt-get update && apt-get install -y iputils-ping iproute2 iptables conntrack net-tools

ENTRYPOINT ["/meep-tc-sidecar"]
+112 −28
Original line number Diff line number Diff line
@@ -92,6 +92,12 @@ type UuMbmsProvisioningInfoProInfoUuMbms struct {
	V2xServerUsd      *V2xServerUsd
}
type UuMbmsProvisioningInfoProInfoUuMbms_list []UuMbmsProvisioningInfoProInfoUuMbms
type Pc5ProvisioningInfoProInfoPc5 struct {
	DstLayer2Id       string
	LocationInfo      *LocationInfo
	NeighbourCellInfo []Pc5NeighbourCellInfo
}
type Pc5ProvisioningInfoProInfoPc5_list []Pc5ProvisioningInfoProInfoPc5
type LocationInfo struct {
	Ecgi    *Ecgi
	GeoArea *LocationInfoGeoArea
@@ -106,11 +112,16 @@ type UuUniNeighbourCellInfo struct {
type UuMbmsNeighbourCellInfo struct {
	Ecgi                    *Ecgi
	FddInfo                 *FddInfo
	MbmsServiceAreaIdentity []string `json:"mbmsServiceAreaIdentity"`
	MbmsServiceAreaIdentity []string
	Pci                     int32
	Plmn                    *Plmn
	TddInfo                 *TddInfo
}
type Pc5NeighbourCellInfo struct {
	Ecgi        *Ecgi
	Plmn        *Plmn
	SiV2xConfig *SystemInformationBlockType21
}
type V2xApplicationServer struct {
	IpAddress string
	UdpPort   string
@@ -120,6 +131,8 @@ type V2xServerUsd struct {
	ServiceAreaIdentifier []string
	Tmgi                  *V2xServerUsdTmgi
}
type SystemInformationBlockType21 struct {
}
type Ecgi struct {
	CellId *CellId
	Plmn   *Plmn
@@ -536,9 +549,9 @@ func GetPredictedPowerValues(hour int32, inRsrp int32, inRsrq int32, poaName str
}

/*
 * GetInfoUuUnicast process the uu_unicast_provisioning_info GETT request and sends the response
 * GetInfoUuUnicast process the uu_unicast_provisioning_info GET request and sends the response
 * @param {struct} params HTTP request parameters
 * @param {struct} num_item contains the number of paraneters
 * @param {struct} num_item contains the number of parameters
 * @return {struct} UuUnicastProvisioningInfoProInfoUuUnicast initialized data structure
 * @see ETSI GS MEC 030 V3.1.1 (2023-03) Clause 7.3.3.1 GET
 */
@@ -607,9 +620,16 @@ func GetInfoUuUnicast(params []string, num_item int) (proInfoUuUnicast UuUnicast
	}

	log.Info("GetInfoUuUnicast: proInfoUuUnicast= ", proInfoUuUnicast)
	return proInfoUuUnicast, err
	return proInfoUuUnicast, nil
}

/*
 * GetInfoUuMbmscast process the uu_mbms_provisioning_info GET request and sends the response
 * @param {struct} params HTTP request parameters
 * @param {struct} num_item contains the number of parameters
 * @return {struct} UuMbmscastProvisioningInfoProInfoUuMbmscast initialized data structure
 * @see ETSI GS MEC 030 V3.1.1 (2023-03) Clause 7.4.3.1 GET
 */
func GetInfoUuMbmscast(params []string, num_item int) (proInfoUuMbmscast UuMbmsProvisioningInfoProInfoUuMbms_list, err error) {
	proInfoUuMbmscast = nil
	resp, err := sbi.trafficMgr.GetInfoUuMbmscast(params, num_item)
@@ -684,42 +704,106 @@ func GetInfoUuMbmscast(params []string, num_item int) (proInfoUuMbmscast UuMbmsP
			}
		} // End of 'for' statement
	}
	// } else if params[0] == "latitude" {
	// 	// var geocoordinatesList gisClient.GeoCoordinateList
	// 	// geocoordinatesList.GeoCoordinates = geocoordinates
	// 	// powerResp, _, err := gisAppClient.GeospatialDataApi.GetGeoDataPowerValues(context.TODO(), geocoordinatesList)
	// 	// log.Info("GetInfoUuMbmscast: powerResp= ", powerResp)
	// 	// if err != nil {
	// 	// 	err = errors.New("GetInfoUuMbmscast: GetGeoDataPowerValues failed")
	// 	// 	log.Error(err.Error())
	// 	// 	return proInfoUuMbmscast, err
	// 	// }
	// 	proInfoUuMbmscast = make([]UuMbmsProvisioningInfoProInfoUuMbms, len(resp))
	// 	proInfoUuMbmscast[0].LocationInfo = new(LocationInfo)
	// 	proInfoUuMbmscast[0].LocationInfo.Ecgi = nil
	// 	proInfoUuMbmscast[0].LocationInfo.GeoArea = nil
	// 	proInfoUuMbmscast[0].NeighbourCellInfo = nil
	// 	err = errors.New("GetInfoUuMbmscast: Location not supported yet")
	// 	log.Error(err.Error())
	// 	return proInfoUuMbmscast, err
	// } else {
	// 	err = errors.New("GetInfoUuMbmscast: Invalid parameter: " + params[0])
	// 	log.Error(err.Error())
	// 	return proInfoUuMbmscast, err
	// }

	log.Info("GetInfoUuMbmscast: proInfoUuMbmscast= ", proInfoUuMbmscast)
	return proInfoUuMbmscast, err
	return proInfoUuMbmscast, nil
}

/*
 * GetInfoPc5 process the pc5_provisioning_info GET request and sends the response
 * @param {struct} params HTTP request parameters
 * @param {struct} num_item contains the number of parameters
 * @return {struct} Pc5ProvisioningInfoProInfoPc5 initialized data structure
 * @see ETSI GS MEC 030 V3.1.1 (2023-03) Clause 7.4.3.1 GET
 */
func GetInfoPc5(params []string, num_item int) (proInfoPc5 Pc5ProvisioningInfoProInfoPc5_list, err error) {
	proInfoPc5 = nil
	resp, err := sbi.trafficMgr.GetInfoPc5(params, num_item)
	log.Info("GetInfoUuMbmscast: resp= ", resp)
	if err != nil {
		log.Error(err.Error())
	} else {
		proInfoPc5 = make([]Pc5ProvisioningInfoProInfoPc5, len(resp))
		for i := range resp {
			proInfoPc5[i].DstLayer2Id = resp[i].DstLayer2Id

			if resp[i].LocationInfo != nil {
				proInfoPc5[i].LocationInfo = new(LocationInfo)
				if resp[i].LocationInfo.Ecgi != nil {
					proInfoPc5[i].LocationInfo.Ecgi = new(Ecgi)
					if resp[i].LocationInfo.Ecgi.CellId != nil {
						proInfoPc5[i].LocationInfo.Ecgi.CellId = new(CellId)
						proInfoPc5[i].LocationInfo.Ecgi.CellId.CellId = resp[i].LocationInfo.Ecgi.CellId.CellId
					}
					if resp[i].LocationInfo.Ecgi.Plmn != nil {
						proInfoPc5[i].LocationInfo.Ecgi.Plmn = new(Plmn)
						proInfoPc5[i].LocationInfo.Ecgi.Plmn.Mcc = resp[i].LocationInfo.Ecgi.Plmn.Mcc
						proInfoPc5[i].LocationInfo.Ecgi.Plmn.Mnc = resp[i].LocationInfo.Ecgi.Plmn.Mnc
					}
				}
				if resp[i].LocationInfo.GeoArea != nil {
					proInfoPc5[i].LocationInfo.GeoArea = new(LocationInfoGeoArea)
					proInfoPc5[i].LocationInfo.GeoArea.Latitude = resp[i].LocationInfo.GeoArea.Latitude
					proInfoPc5[i].LocationInfo.GeoArea.Longitude = resp[i].LocationInfo.GeoArea.Longitude
				}
			}

			if resp[i].NeighbourCellInfo != nil {
				proInfoPc5[i].NeighbourCellInfo = make([]Pc5NeighbourCellInfo, len(resp[i].NeighbourCellInfo))
				for j := range resp[i].NeighbourCellInfo {

					if resp[i].NeighbourCellInfo[j].Ecgi != nil {
						proInfoPc5[i].NeighbourCellInfo[j].Ecgi = new(Ecgi)
						if resp[i].NeighbourCellInfo[j].Ecgi.CellId != nil {
							proInfoPc5[i].NeighbourCellInfo[j].Ecgi.CellId = new(CellId)
							proInfoPc5[i].NeighbourCellInfo[j].Ecgi.CellId.CellId = resp[i].NeighbourCellInfo[j].Ecgi.CellId.CellId
						}
						if resp[i].NeighbourCellInfo[j].Ecgi.Plmn != nil {
							proInfoPc5[i].NeighbourCellInfo[j].Ecgi.Plmn = new(Plmn)
							proInfoPc5[i].NeighbourCellInfo[j].Ecgi.Plmn.Mcc = resp[i].NeighbourCellInfo[j].Ecgi.Plmn.Mcc
							proInfoPc5[i].NeighbourCellInfo[j].Ecgi.Plmn.Mnc = resp[i].NeighbourCellInfo[j].Ecgi.Plmn.Mnc
						}
					}

					if resp[i].NeighbourCellInfo[j].SiV2xConfig != nil {
						proInfoPc5[i].NeighbourCellInfo[j].SiV2xConfig = new(SystemInformationBlockType21)
					}
				} // End of 'for' statement
			}
		} // End of 'for' statement
	}

	log.Info("GetInfoUuMbmscast: proInfoPc5= ", proInfoPc5)
	return proInfoPc5, nil
}

/*
 * PublishMessageOnMessageBroker publish the provided V2X message (e.g. CA message) on brocker server (e.g. MQTT)
 * @param {string} msgContent The message to publish
 * @param {string} msgEncodeFormat contains the encoding format uses to encode the V2X raw message
 * @param {string} stdOrganization ontains the V2X standard which apply to the V2X message (e,g, ETSI for C-ITS)
 * @param {struct} msgType conatins the type of the V2X message (e.g. CA message)
 * @return {struct} nil on success, error otherwise
 * @see ETSI GS MEC 030 V3.1.1 (2023-03) Annex D (informative): State-of-the-art of using a Message Broker as V2X Message Distribution Server for exchanging non-session based V2X messages
 */
func PublishMessageOnMessageBroker(msgContent string, msgEncodeFormat string, stdOrganization string, msgType *int32) (err error) {
	return sbi.trafficMgr.PublishMessageOnMessageBroker(msgContent, msgEncodeFormat, stdOrganization, msgType)
}

/*
 * StartV2xMessageBrokerServer start the brocker server (e.g. MQTT)
 * @return {struct} nil on success, error otherwise
 * @see ETSI GS MEC 030 V3.1.1 (2023-03) Annex D (informative): State-of-the-art of using a Message Broker as V2X Message Distribution Server for exchanging non-session based V2X messages
 */
func StartV2xMessageBrokerServer() (err error) {
	return sbi.trafficMgr.StartV2xMessageBrokerServer()
}

/*
 * StopV2xMessageBrokerServer shutdown the brocker server (e.g. MQTT)
 * @return {struct} nil on success, error otherwise
 * @see ETSI GS MEC 030 V3.1.1 (2023-03) Annex D (informative): State-of-the-art of using a Message Broker as V2X Message Distribution Server for exchanging non-session based V2X messages
 */
func StopV2xMessageBrokerServer() {
	sbi.trafficMgr.StopV2xMessageBrokerServer()
}
+1495 −1302

File changed.

Preview size limit exceeded, changes collapsed.

+8 −8
Original line number Diff line number Diff line
@@ -1108,7 +1108,7 @@ func testProvUuUniSubscriptionPost(t *testing.T, requestTestNotification bool, e
	// MEC-030 Clause 6.3.5
	// MEC-030 Clause 7.8.3.4
	expected_subscriptionType := PROV_CHG_UU_UNI
	expected_callbackReference := "http://localhost:8099/callback/vis/v2/ProvChgUuUniSubscription/"
	expected_callbackReference := "http://localhost:8080/callback/vis/v2/ProvChgUuUniSubscription/"
	expected_href := LinkType{Href: "http://localhost/testScenario/vis/v2/subscriptions/1"}
	expected_self := Links{Self: &expected_href}
	ecgi_1 := Ecgi{
@@ -1160,7 +1160,7 @@ func testProvUuUniSubscriptionPost(t *testing.T, requestTestNotification bool, e
	 * request body section
	 ******************************/
	subscriptionType := PROV_CHG_UU_UNI
	callbackReference := "http://localhost:8099/callback/vis/v2/ProvChgUuUniSubscription/"
	callbackReference := "http://localhost:8080/callback/vis/v2/ProvChgUuUniSubscription/"
	filterCriteria := ProvChgUuUniSubscriptionFilterCriteria{LocationInfo: locationInfo, NeighbourCellInfo: uuUniNeighbourCellInfo, V2xApplicationServer: v2xApplicationServer}
	var expiryDeadline *TimeStamp = nil
	if expiryNotification {
@@ -1425,7 +1425,7 @@ func testV2xMsgSubscriptionPost(t *testing.T, requestTestNotification bool, expi
	// MEC-030 Clause 6.3.5
	// MEC-030 Clause 7.8.3.4
	expected_subscriptionType := V2X_MSG
	expected_callbackReference := "http://localhost:8099/callback/vis/v2/V2xMsgSubscription/"
	expected_callbackReference := "http://localhost:8080/callback/vis/v2/V2xMsgSubscription/"
	expected_href := LinkType{Href: "http://localhost/testScenario/vis/v2/subscriptions/1"}
	expected_self := Links{Self: &expected_href}
	expected_msgType := []string{"DENM", "CAM"}
@@ -1453,7 +1453,7 @@ func testV2xMsgSubscriptionPost(t *testing.T, requestTestNotification bool, expi
	 * request body section
	 ******************************/
	subscriptionType := V2X_MSG
	callbackReference := "http://localhost:8099/callback/vis/v2/V2xMsgSubscription/"
	callbackReference := "http://localhost:8080/callback/vis/v2/V2xMsgSubscription/"
	msgType := []string{"DENM", "CAM"}
	msgProtocolVersion := []int32{1}
	filterCriteria := V2xMsgFilterCriteria{make([]LocationInfo, 0), msgProtocolVersion, msgType, "ETSI"}
@@ -1822,7 +1822,7 @@ func testIndividualSubscriptionV2xMsgSubscriptionPut(t *testing.T, subscriptionT
	 * expected response section
	 ******************************/
	expected_subscriptionType := subscriptionType
	expected_callbackReference := "http://localhost:8099/callback/vis/v2/" + subscriptionType + "/"
	expected_callbackReference := "http://localhost:8080/callback/vis/v2/" + subscriptionType + "/"
	expected_href := LinkType{Href: "http://localhost/vis/v2/subscriptions/" + subscriptionType + "/" + subscriptionId}
	expected_self := Links{Self: &expected_href}
	expected_msgType := []string{"DENM", "CAM"}
@@ -1853,7 +1853,7 @@ func testIndividualSubscriptionV2xMsgSubscriptionPut(t *testing.T, subscriptionT
	/******************************
	 * request body section
	 ******************************/
	callbackReference := "http://localhost:8099/callback/vis/v2/" + subscriptionType + "/"
	callbackReference := "http://localhost:8080/callback/vis/v2/" + subscriptionType + "/"
	href := LinkType{Href: "http://localhost/vis/v2/subscriptions/" + subscriptionType + "/1"}
	self := Links{Self: &href}
	msgType := []string{"DENM", "CAM"}
@@ -1913,7 +1913,7 @@ func testProvChgUuUniSubscriptionPut(t *testing.T, subscriptionType string, subs
	 * expected response section
	 ******************************/
	expected_subscriptionType := subscriptionType
	expected_callbackReference := "http://localhost:8099/callback/vis/v2/" + subscriptionType + "/"
	expected_callbackReference := "http://localhost:8080/callback/vis/v2/" + subscriptionType + "/"
	expected_href := LinkType{Href: "http://localhost/vis/v2/subscriptions/" + subscriptionType + "/" + subscriptionId}
	expected_self := Links{Self: &expected_href}
	ecgi_1 := Ecgi{
@@ -1961,7 +1961,7 @@ func testProvChgUuUniSubscriptionPut(t *testing.T, subscriptionType string, subs
	/******************************
	 * request body section
	 ******************************/
	callbackReference := "http://localhost:8099/callback/vis/v2/" + subscriptionType + "/"
	callbackReference := "http://localhost:8080/callback/vis/v2/" + subscriptionType + "/"
	href := LinkType{Href: "http://localhost/vis/v2/subscriptions/" + subscriptionType + "/" + subscriptionId}
	self := Links{Self: &href}
	filterCriteria := ProvChgUuUniSubscriptionFilterCriteria{&locationInfo, uuUniNeighbourCellInfo, v2xApplicationServer}
+227 −38

File changed.

Preview size limit exceeded, changes collapsed.

Loading