Commit 46286882 authored by YannGarcia's avatar YannGarcia
Browse files

Merge MEC developments with ITS/NG112 developments

parent 4688594a
Loading
Loading
Loading
Loading

Makefile

0 → 100644
+119 −0
Original line number Original line Diff line number Diff line
-include config.mk

ifeq (,$(ATS))
 $(error ATS shall be defined)
endif

ifeq (,$(TOPDIR))
 TOPDIR := .
endif

ifeq (,$(TTCN3_DIR))
 $(error TTCN3_DIR shall be defined in config.mk)
endif
first: all

define IncludeModule
undefine sources
undefine modules
undefine includes
include $(1)/module.mk
$$(foreach S, $$(sources),  $$(eval all_sources +=  $(1)/$$(S)))
$$(foreach I, $$(includes), $$(eval all_includes += $(1)/$$(I)))
$$(foreach M, $$(modules),  $$(eval $$(call IncludeModule, $$(if $$(filter /%, $$(M)), $$(M), $(1)/$$(M)))))
endef

all_includes := $(TTCN3_DIR)/include $(TTCN3_DIR)/src $(TOPDIR)/ccsrc/Framework
defines  += TITAN_RUNTIME_2 _NO_SOFTLINKS_ $(ATS) AS_USE_SSL
libs     += $(TTCN3_DIR)/lib/libttcn3-rt2-parallel.a -lstdc++fs

ifeq (Windows_NT,$(OS))
# Silence linker warnings.
LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
defines += WIN32
libs += $(patsubst %, -L%/lib, $(OPENSSL_DIR))
all_includes += $(addsuffix /include, $(OPENSSL_DIR))
libs += $(WPCAP_DLL_PATH)
else
defines += LINUX
libs += -lpcap -lrt -lpthread
endif

libs += -lssl -lcrypto -lxml2

$(eval $(call IncludeModule, $(TOPDIR)/ttcn/$(ATS)))

outdir := $(TOPDIR)/build/$(ATS)
bindir := $(TOPDIR)/bin

sources     := $(sort $(all_sources))
includes    := $(outdir) $(outdir)/.. $(all_includes) $(NPCAP_INCLUDE)

ifeq (Windows_NT,$(OS))
  EXE=.exe
endif

ttcn_sources  := $(filter %.ttcn , $(sources))
ttcn3_sources := $(filter %.ttcn3, $(sources))

tt_sources    := $(ttcn_sources) $(ttcn3_sources)
cc_sources    := $(filter %.cc,    $(sources))

gen_ttcn_sources  := $(addprefix $(outdir)/, $(notdir $(patsubst %.ttcn,  %.cc, $(ttcn_sources))))
gen_ttcn_headers  := $(addprefix $(outdir)/, $(notdir $(patsubst %.ttcn,  %.hh, $(ttcn_sources))))
gen_ttcn3_sources := $(addprefix $(outdir)/, $(notdir $(patsubst %.ttcn3, %.cc, $(ttcn3_sources))))
gen_ttcn3_headers := $(addprefix $(outdir)/, $(notdir $(patsubst %.ttcn3, %.hh, $(ttcn3_sources))))

gen_sources := $(gen_ttcn_sources) $(gen_ttcn3_sources)
gen_headers := $(gen_ttcn_headers) $(gen_ttcn3_headers)

gen_objects := $(patsubst %.cc, %.o, $(gen_sources))
cc_objects  := $(patsubst  %.cc, $(outdir)/%.o, $(cc_sources))

.PHONY: all FORCE echo

all: $(bindir) $(outdir) $(bindir)/$(ATS)$(EXE)

echo_sources:
	@echo -e "$(addsuffix \n,$(all_sources))"

echo: echo_sources
	@echo -e "sources:\n $(addsuffix \n, $(sources))"
	@echo -e "gen_sources:\n $(addsuffix \n, $(gen_sources))"
	@echo -e "gen_objects:\n $(addsuffix \n, $(gen_objects))"
	@echo -e "cc_objects:\n $(addsuffix \n, $(cc_objects))"
	@echo -e "includes:\n $(addsuffix \n, $(includes))"
	@echo -e "defines: $(addsuffix \n, $(defines))"

clean:
	rm -f $(outdir)/$(ATS)$(EXE) $(gen_objects) $(gen_sources) $(gen_headers) $(cc_objects) $(outdir)/.generate

regen: force_regen $(outdir)/.generate
force_regen:
	rm -f $(outdir)/.generate

$(outdir) $(bindir):
	mkdir -p $@

$(bindir)/$(ATS)$(EXE): $(gen_objects) $(cc_objects) 
	g++ -g -O0 -o $@ $(LDFLAGS) $(gen_objects) $(cc_objects) $(libs)

$(gen_objects) :%.o :%.cc
	g++ -g -O0 -c $(addprefix -D, $(defines)) $(addprefix -I, $(includes)) -o $@ $<

$(cc_objects) : $(outdir)/%.o : %.cc
	mkdir -p $(dir $@)
	g++ -g -O0 -c $(addprefix -D, $(defines)) $(addprefix -I, $(includes)) -o $@ $<

#$(gen_sources):
#	$(TTCN3_DIR)/bin/compiler -n -e -L -R -U none -o $(outdir) $(tt_sources)

$(gen_sources): $(outdir)/.generate

$(outdir)/.generate: Makefile $(tt_sources)
	$(TTCN3_DIR)/bin/compiler -b -d -e -f -g -l -L -M -n -O -r -R -U none -x -X -o $(outdir) $(tt_sources)
	touch $@

$(foreach S, $(ttcn_sources),  $(eval $(outdir)/$(notdir $(patsubst %.ttcn, %.cc,  $(S))): $(S)))
$(foreach S, $(ttcn3_sources), $(eval $(outdir)/$(notdir $(patsubst %.ttcn3, %.cc, $(S))): $(S)))
+1 −0
Original line number Original line Diff line number Diff line
sources := LibItsHttp_Encdec.cc
+1 −0
Original line number Original line Diff line number Diff line
sources := LibMec_EncDec.cc
+1 −0
Original line number Original line Diff line number Diff line
sources := LocationAPI
+44 −4
Original line number Original line Diff line number Diff line
@@ -11,6 +11,7 @@
#pragma once
#pragma once


#include <vector>
#include <vector>
#include <string>
#include <map>
#include <map>


  /*!
  /*!
@@ -29,10 +30,53 @@ public: //! \publicsection
  static const std::string& mac_dst;               //! Destination MAC address parameter name
  static const std::string& mac_dst;               //! Destination MAC address parameter name
  static const std::string& mac_bc;                //! Broadcast MAC address parameter name
  static const std::string& mac_bc;                //! Broadcast MAC address parameter name
  static const std::string& eth_type;              //! Ethernet type parameter name
  static const std::string& eth_type;              //! Ethernet type parameter name
  static const std::string& beaconing;             //! Beaconing mode parameter name
  static const std::string& timestamp;             //! Packet reception timestamp
  static const std::string& station_type;
  static const std::string& country;
  static const std::string& type_of_address;
  static const std::string& ssp;                   //! SSP parameter name
  static const std::string& its_aid;               //! ITS-AID parameter name
  static const std::string& gn_payload;            //! GeoNetworking Payload parameter name
  static const std::string& gn_next_header;        //! GeoNetworking NextHeader parameter name
  static const std::string& gn_header_type;        //! GeoNetworking HeaderType parameter name
  static const std::string& gn_header_sub_type;    //! GeoNetworking HeaderSubType parameter name
  static const std::string& gn_lifetime;           //! GeoNetworking Lifetime parameter name
  static const std::string& gn_traffic_class;      //! GeoNetworking Traffic class parameter name
  static const std::string& btp_type;              //! BTP Type parameter name
  static const std::string& btp_payload;           //! BTP Payload parameter name
  static const std::string& btp_destination_port;  //! BTP DestinationPort parameter name
  static const std::string& btp_info;              //! BTP Info parameter name

  static const std::string& nic;                   //! Network Interface Card parameter name
  static const std::string& nic;                   //! Network Interface Card parameter name
  static const std::string& ll_address;            //! Test system GeoNetworking LL-Address parameter name
  static const std::string& latitude;              //! Test system Latitude parameter name
  static const std::string& latitude;              //! Test system Latitude parameter name
  static const std::string& longitude;             //! Test system Longitude parameter name
  static const std::string& longitude;             //! Test system Longitude parameter name
  static const std::string& expiry;                //! Test system GeoNetworking Lifetime parameter name (in ms)

  static const std::string& station_id;            //! To indicate to the peer ITS_Container::stationID

  static const std::string& device_mode;           //! To indicate to the lower layer to act as a standalone device
  static const std::string& device_mode;           //! To indicate to the lower layer to act as a standalone device
  static const std::string& secured_mode;          //! To indicate to the lower layer to apply signature on message exchanges as defined in IEEE 1609.2 & ETSI TS 102 965
  static const std::string& encrypted_mode;        //! To indicate to the lower layer to apply encryption on message exchanges as defined in IEEE 1609.2 & ETSI TS 102 965
  static const std::string& enable_security_checks;//! To indicates if security check failures shall be treated as error or warning
  static const std::string& sec_db_path;           //! Path to the folder containing certificates
  static const std::string& certificate;           //! The certificate identifier the Test System shall use. E.g. CERT_TS_A
  static const std::string& peer_certificate;      //! The peer certificate identifier the Test System shall use for encryption. E.g. CERT_TS_A
  static const std::string& hash;                  //! The digest algorithm the Test System shall use, authorised values are SHA-256 or SHA-384. Default: SHA-256
  static const std::string& signature;             //! The signature algorithm the Test System shall use, authorised values are NISTP-256, BP-256 and BP-384. Default: NISTP-256
  static const std::string& cypher;                //! The encryption algorithm the Test System shall use, authorised values are NISTP-256 and BP-256. Default: NISTP-256
  static const std::string& distanceA;             //! Test system GeoNetworking DistanceA parameter name
  static const std::string& distanceB;             //! Test system GeoNetworking DistanceB parameter name
  static const std::string& angle;                 //! Test system GeoNetworking Angle parameter name

  static const std::string& payload_type;          //! Tyoe of payload, value is the ITS Conatainer message identifier or omitted in case of unknown payload

  static const std::string& next_header;           //! Upper layer settings
  static const std::string& header_type;           //! Upper layer settings
  static const std::string& header_sub_type;       //! Upper layer settings
  
  static const std::string& interface_id;          //! Commsignia antenna selector


  static const std::string& server;                //! HTTP server address (e.g. www.etsi.org)
  static const std::string& server;                //! HTTP server address (e.g. www.etsi.org)
  static const std::string& port;                  //! HTTP server port. Default: 80
  static const std::string& port;                  //! HTTP server port. Default: 80
@@ -45,10 +89,6 @@ public: //! \publicsection
  static const std::string& host;                  //! HTTP Host value. Default: 127.0.0.1
  static const std::string& host;                  //! HTTP Host value. Default: 127.0.0.1
  static const std::string& content_type;          //! HTTP Content-type value. Default: application/text
  static const std::string& content_type;          //! HTTP Content-type value. Default: application/text


  static const std::string& sip_url;
  static const std::string& sip_version;
  static const std::string& payload;               //! UpperLayer Payload parameter name

  static const std::string& codecs;                //! List of codecs to use for HTTP application layers
  static const std::string& codecs;                //! List of codecs to use for HTTP application layers


  /*!
  /*!
Loading