Add HTTP/2 support
Compare changes
Files
24@@ -13,17 +13,14 @@
@@ -34,17 +31,16 @@ void IndividualSMPolicyDocumentApi::init() {
@@ -183,6 +179,4 @@ void IndividualSMPolicyDocumentApi::
Implements issue #9 (closed)
impl
classes to handler
.api_defs.h
The architecture allows to completely re-use the logic from the previous handler. We could also apply the same to other NFs (long-term). There is also the potential to move some parts to common (e.g. api_response
).
I decided to use Pistache
headers in the api_response
. While this breaks a bit the abstraction, I really like that they have defined classes for each header type. If we ever go away from pistache, we will need to update this.
Tested with CURL requests.
curl --http2-prior-knowledge -X POST http://host:port/npcf-smpolicycontrol/v1/sm-policies -H 'Content-Type: application/json' -d @test_request.json
test_request.json:
{
"supi": "imsi-208950000000032",
"pduSessionType": "IPV4",
"pduSessionId": 42,
"dnn": "default",
"notificationUri": "not_supported_right_now",
"sliceInfo": {
"sst": 222,
"sd": "123"
}
}
curl --http2-prior-knowledge -X GET http://192.168.70.1:8091/npcf-smpolicycontrol/v1/sm-policies/1
curl --http2-prior-knowledge -i -X POST http://192.168.70.1:8091/npcf-smpolicycontrol/v1/sm-policies/1/update -H 'Content-Type: application/json' -d '{"repPolicyCtrlReqTriggers": ["UE_IP_CH"], "ipv4Address": "10.20.30.40"}'
curl --http2-prior-knowledge -i -X POST http://192.168.70.1:8091/npcf-smpolicycontrol/v1/sm-policies/1/delete -H 'Content-Type: application/json' -d '{}'