[ALL] Removing trailing whitespace and tab

This commit is contained in:
Sukchan Lee 2022-09-02 23:38:39 +09:00
parent 5295c108ad
commit 1d17e68c56
66 changed files with 1461 additions and 1461 deletions

View File

@ -20,17 +20,17 @@ set -e
case "$1" in
configure)
# create a open5gs group and user
if ! getent passwd open5gs >/dev/null; then
adduser --system --disabled-password --disabled-login \
--home /var/run/open5gs --no-create-home \
--quiet --group open5gs
fi
for dir in /var/log/open5gs; do
if ! dpkg-statoverride --list "$dir" >/dev/null 2>&1; then
dpkg-statoverride --update --add open5gs open5gs 0755 "$dir"
fi
done
# create a open5gs group and user
if ! getent passwd open5gs >/dev/null; then
adduser --system --disabled-password --disabled-login \
--home /var/run/open5gs --no-create-home \
--quiet --group open5gs
fi
for dir in /var/log/open5gs; do
if ! dpkg-statoverride --list "$dir" >/dev/null 2>&1; then
dpkg-statoverride --update --add open5gs open5gs 0755 "$dir"
fi
done
;;
abort-upgrade|abort-remove|abort-deconfigure)

View File

@ -20,20 +20,20 @@ set -e
case "$1" in
configure)
if test "x`sysctl -n net.ipv6.conf.all.disable_ipv6`" = x1; then
echo "net.ipv6.conf.all.disable_ipv6=0" > /etc/sysctl.d/30-open5gs.conf
sysctl -p /etc/sysctl.d/30-open5gs.conf
fi
if test "x`systemctl is-enabled systemd-networkd`" = xdisabled; then
systemctl enable systemd-networkd
fi
if test -d "/run/systemd"; then
deb-systemd-invoke restart systemd-networkd
fi
if test -f /etc/sysctl.d/30-open5gs.conf && grep "ogstun" /proc/net/dev > /dev/null; then
echo "net.ipv6.conf.ogstun.disable_ipv6=0" > /etc/sysctl.d/30-open5gs.conf
sysctl -p /etc/sysctl.d/30-open5gs.conf
fi
if test "x`sysctl -n net.ipv6.conf.all.disable_ipv6`" = x1; then
echo "net.ipv6.conf.all.disable_ipv6=0" > /etc/sysctl.d/30-open5gs.conf
sysctl -p /etc/sysctl.d/30-open5gs.conf
fi
if test "x`systemctl is-enabled systemd-networkd`" = xdisabled; then
systemctl enable systemd-networkd
fi
if test -d "/run/systemd"; then
deb-systemd-invoke restart systemd-networkd
fi
if test -f /etc/sysctl.d/30-open5gs.conf && grep "ogstun" /proc/net/dev > /dev/null; then
echo "net.ipv6.conf.ogstun.disable_ipv6=0" > /etc/sysctl.d/30-open5gs.conf
sysctl -p /etc/sysctl.d/30-open5gs.conf
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)

View File

@ -24,7 +24,7 @@ case "$1" in
if grep "ogstun" /proc/net/dev > /dev/null; then
ip tuntap del name ogstun mode tun
fi
rm -f /etc/sysctl.d/30-open5gs.conf
rm -f /etc/sysctl.d/30-open5gs.conf
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)

View File

@ -97,8 +97,8 @@ Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username
```diff
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
--- amf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ amf.yaml.new 2020-09-05 20:55:07.453114885 -0400
--- amf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ amf.yaml.new 2020-09-05 20:55:07.453114885 -0400
@@ -165,23 +165,23 @@
- addr: 127.0.0.5
port: 7777
@ -136,8 +136,8 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
```diff
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
--- upf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ upf.yaml.new 2020-09-05 20:52:55.279052142 -0400
--- upf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ upf.yaml.new 2020-09-05 20:52:55.279052142 -0400
@@ -137,9 +137,7 @@
pfcp:
- addr: 127.0.0.7
@ -156,8 +156,8 @@ Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml 2020-09-05 20:52:28.648235143 -0400
+++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400
--- mme.yaml 2020-09-05 20:52:28.648235143 -0400
+++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400
@@ -204,20 +204,20 @@
mme:
freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
@ -190,8 +190,8 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
```diff
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
+++ sgwu.yaml.new 2020-09-05 20:51:06.667838823 -0400
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
+++ sgwu.yaml.new 2020-09-05 20:51:06.667838823 -0400
@@ -51,7 +51,7 @@
#
sgwu:

View File

@ -56,8 +56,8 @@ Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml.old 2020-08-22 11:36:40.512418765 -0400
+++ mme.yaml 2020-08-22 11:36:27.081466682 -0400
--- mme.yaml.old 2020-08-22 11:36:40.512418765 -0400
+++ mme.yaml 2020-08-22 11:36:27.081466682 -0400
@@ -204,20 +204,20 @@
mme:
freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
@ -113,8 +113,8 @@ $ diff -u /etc/open5gs/sgwc.yaml.old /etc/open5gs/sgwc.yaml
Modify [install/etc/open5gs/smf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/smf.yaml.in) to set the PFCP IP address.
```diff
$ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
--- smf.yaml.old 2020-08-22 11:37:39.990816411 -0400
+++ smf.yaml 2020-08-22 11:38:18.647999952 -0400
--- smf.yaml.old 2020-08-22 11:37:39.990816411 -0400
+++ smf.yaml 2020-08-22 11:38:18.647999952 -0400
@@ -187,8 +187,7 @@
- addr: 127.0.0.4
- addr: ::1
@ -141,8 +141,8 @@ Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username
```diff
diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
--- amf.yaml.old 2020-06-21 23:34:14.643114779 -0400
+++ amf.yaml 2020-06-21 23:34:28.718482095 -0400
--- amf.yaml.old 2020-06-21 23:34:14.643114779 -0400
+++ amf.yaml 2020-06-21 23:34:28.718482095 -0400
@@ -67,25 +67,25 @@
- addr: 127.0.0.5
port: 7777
@ -183,8 +183,8 @@ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U and PFCP IP address.
```diff
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml.old 2020-08-22 11:41:09.214670723 -0400
+++ sgwu.yaml 2020-08-22 11:41:27.433937124 -0400
--- sgwu.yaml.old 2020-08-22 11:41:09.214670723 -0400
+++ sgwu.yaml 2020-08-22 11:41:27.433937124 -0400
@@ -51,9 +51,9 @@
#
sgwu:
@ -202,8 +202,8 @@ $ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
```diff
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
--- upf.yaml.old 2020-08-22 11:42:57.781750067 -0400
+++ upf.yaml 2020-08-22 11:43:13.268901616 -0400
--- upf.yaml.old 2020-08-22 11:42:57.781750067 -0400
+++ upf.yaml 2020-08-22 11:43:13.268901616 -0400
@@ -59,11 +59,9 @@
#
upf:

View File

@ -176,8 +176,8 @@ You can modify the configuration file to record more logs.
```diff
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
--- amf.yaml.old 2020-08-22 12:26:56.132213488 -0400
+++ amf.yaml 2020-08-22 12:27:04.135901201 -0400
--- amf.yaml.old 2020-08-22 12:26:56.132213488 -0400
+++ amf.yaml 2020-08-22 12:27:04.135901201 -0400
@@ -20,6 +20,7 @@
#
logger:

View File

@ -96,63 +96,63 @@ $ mongo
> use open5gs
> db.subscribers.find().pretty()
{
"_id" : ObjectId("60969fe79459f8b40d8d3f68"),
"imsi" : "999700000000001",
"__v" : 0,
"access_restriction_data" : 32,
"ambr" : {
"uplink" : {
"value" : 1,
"unit" : 3
},
"downlink" : {
"value" : 1,
"unit" : 3
}
},
"network_access_mode" : 2,
"security" : {
"k" : "465b5ce8b199b49faa5f0a2ee238a6bc",
"amf" : "8000",
"op" : null,
"opc" : "e8ed289deba952e4283b54e88e6183ca",
"sqn" : NumberLong(97)
},
"slice" : [
{
"sst" : 1,
"default_indicator" : true,
"_id" : ObjectId("60969fe7de8743b3c7b1a973"),
"session" : [
{
"name" : "internet",
"type" : 3,
"_id" : ObjectId("60969fe7de8743b3c7b1a974"),
"pcc_rule" : [ ],
"ambr" : {
"uplink" : {
"value" : 1,
"unit" : 3
},
"downlink" : {
"value" : 1,
"unit" : 3
}
},
"qos" : {
"index" : 9,
"arp" : {
"priority_level" : 8,
"pre_emption_capability" : 1,
"pre_emption_vulnerability" : 1
}
}
}
]
}
],
"subscribed_rau_tau_timer" : 12,
"subscriber_status" : 0
"_id" : ObjectId("60969fe79459f8b40d8d3f68"),
"imsi" : "999700000000001",
"__v" : 0,
"access_restriction_data" : 32,
"ambr" : {
"uplink" : {
"value" : 1,
"unit" : 3
},
"downlink" : {
"value" : 1,
"unit" : 3
}
},
"network_access_mode" : 2,
"security" : {
"k" : "465b5ce8b199b49faa5f0a2ee238a6bc",
"amf" : "8000",
"op" : null,
"opc" : "e8ed289deba952e4283b54e88e6183ca",
"sqn" : NumberLong(97)
},
"slice" : [
{
"sst" : 1,
"default_indicator" : true,
"_id" : ObjectId("60969fe7de8743b3c7b1a973"),
"session" : [
{
"name" : "internet",
"type" : 3,
"_id" : ObjectId("60969fe7de8743b3c7b1a974"),
"pcc_rule" : [ ],
"ambr" : {
"uplink" : {
"value" : 1,
"unit" : 3
},
"downlink" : {
"value" : 1,
"unit" : 3
}
},
"qos" : {
"index" : 9,
"arp" : {
"priority_level" : 8,
"pre_emption_capability" : 1,
"pre_emption_vulnerability" : 1
}
}
}
]
}
],
"subscribed_rau_tau_timer" : 12,
"subscriber_status" : 0
}
```
@ -163,43 +163,43 @@ $ mongo
> use open5gs
> db.subscribers.find().pretty()
{
"_id" : ObjectId("609715fda08851a0744e6ae7"),
"imsi" : "999700000021309",
"__v" : 0,
"access_restriction_data" : 32,
"ambr" : {
"downlink" : NumberLong(1024000),
"uplink" : NumberLong(1024000)
},
"network_access_mode" : 2,
"pdn" : [
{
"apn" : "internet",
"_id" : ObjectId("609715fd455bcd38c884ce85"),
"pcc_rule" : [ ],
"ambr" : {
"downlink" : NumberLong(1024000),
"uplink" : NumberLong(1024000)
},
"qos" : {
"qci" : 9,
"arp" : {
"priority_level" : 8,
"pre_emption_vulnerability" : 1,
"pre_emption_capability" : 0
}
},
"type" : 0
}
],
"security" : {
"k" : "70D49A71DD1A2B806A25ABE0EF749F1E",
"amf" : "8000",
"op" : null,
"opc" : "6F1BF53D624B3A43AF6592854E2444C7"
},
"subscribed_rau_tau_timer" : 12,
"subscriber_status" : 0
"_id" : ObjectId("609715fda08851a0744e6ae7"),
"imsi" : "999700000021309",
"__v" : 0,
"access_restriction_data" : 32,
"ambr" : {
"downlink" : NumberLong(1024000),
"uplink" : NumberLong(1024000)
},
"network_access_mode" : 2,
"pdn" : [
{
"apn" : "internet",
"_id" : ObjectId("609715fd455bcd38c884ce85"),
"pcc_rule" : [ ],
"ambr" : {
"downlink" : NumberLong(1024000),
"uplink" : NumberLong(1024000)
},
"qos" : {
"qci" : 9,
"arp" : {
"priority_level" : 8,
"pre_emption_vulnerability" : 1,
"pre_emption_capability" : 0
}
},
"type" : 0
}
],
"security" : {
"k" : "70D49A71DD1A2B806A25ABE0EF749F1E",
"amf" : "8000",
"op" : null,
"opc" : "6F1BF53D624B3A43AF6592854E2444C7"
},
"subscribed_rau_tau_timer" : 12,
"subscriber_status" : 0
}
```
@ -226,12 +226,12 @@ $ mongo
> db.subscribers.find().pretty()
{
...
"slice" : [
{
"sst" : 1,
"default_indicator" : true,
"_id" : ObjectId("60969fe7de8743b3c7b1a973"),
"session" : [
"slice" : [
{
"sst" : 1,
"default_indicator" : true,
"_id" : ObjectId("60969fe7de8743b3c7b1a973"),
"session" : [
...
}
```
@ -476,8 +476,8 @@ The Open5GS package contains a systemd-networkd configuration file for `ogstun`.
```diff
$ diff -u /etc/systemd/network/99-open5gs.network /etc/systemd/network/99-open5gs.network.new
--- /etc/systemd/network/99-open5gs.network 2020-09-17 09:29:09.137392040 -0400
+++ /etc/systemd/network/99-open5gs.network.new 2020-09-17 09:29:03.375719620 -0400
--- /etc/systemd/network/99-open5gs.network 2020-09-17 09:29:09.137392040 -0400
+++ /etc/systemd/network/99-open5gs.network.new 2020-09-17 09:29:03.375719620 -0400
@@ -2,5 +2,5 @@
Name=ogstun
@ -501,8 +501,8 @@ Now, you need to modify the configuration file of Open5GS to adjust the UE IP Po
```diff
$ diff -u smf.yaml smf.yaml.new
--- smf.yaml 2020-09-17 09:31:16.547882093 -0400
+++ smf.yaml.new 2020-09-17 09:32:18.267726844 -0400
--- smf.yaml 2020-09-17 09:31:16.547882093 -0400
+++ smf.yaml.new 2020-09-17 09:32:18.267726844 -0400
@@ -190,7 +190,7 @@
- addr: 127.0.0.4
- addr: ::1
@ -516,8 +516,8 @@ $ diff -u smf.yaml smf.yaml.new
```diff
$ diff -u upf.yaml upf.yaml.new
--- upf.yaml 2020-09-17 09:31:16.547882093 -0400
+++ upf.yaml.new 2020-09-17 09:32:25.199619989 -0400
--- upf.yaml 2020-09-17 09:31:16.547882093 -0400
+++ upf.yaml.new 2020-09-17 09:32:25.199619989 -0400
@@ -139,7 +139,7 @@
gtpu:
- addr: 127.0.0.7
@ -766,8 +766,8 @@ Create **newtables** file as below.
```diff
$ diff -u oldtables newtables
--- oldtables 2019-06-01 23:43:50.354974226 +0900
+++ newtables 2019-06-01 23:44:16.110931684 +0900
--- oldtables 2019-06-01 23:43:50.354974226 +0900
+++ newtables 2019-06-01 23:44:16.110931684 +0900
@@ -8,6 +8,7 @@
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
@ -1273,10 +1273,10 @@ $ echo $(cd $(dirname ./install/lib/x86_64-linux-gnu/) && pwd -P)/$(basename ./i
$ export LD_LIBRARY_PATH=/home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu
$ ldd ./install/bin/open5gs-amfd
...
libogsapp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogsapp.so.1 (0x00007f161ab51000)
libogscore.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogscore.so.1 (0x00007f161a922000)
libogssctp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogssctp.so.1 (0x00007f161a71d000)
libogss1ap.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogss1ap.so.1 (0x00007f161a519000)
libogsapp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogsapp.so.1 (0x00007f161ab51000)
libogscore.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogscore.so.1 (0x00007f161a922000)
libogssctp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogssctp.so.1 (0x00007f161a71d000)
libogss1ap.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogss1ap.so.1 (0x00007f161a519000)
...
```

View File

@ -190,7 +190,7 @@ Title : sysmocom SIM Card Details / AM93\PICK\00859
IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 KIK1
...
999700000017408 8988211000000174089 0100 3623 84724035 8774 57473966 B1233463AB9BC2AD2DB1830EB6417E7B 625150E2A943E3353DD23554101CAFD4 47190711 C865CAA0A54542333929B29B116F4375 7D7F65DCD99003C0A0D5D31CA3E5253E 5B27983AF628FC3FCB36B89300012944
999700000017408 8988211000000174089 0100 3623 84724035 8774 57473966 B1233463AB9BC2AD2DB1830EB6417E7B 625150E2A943E3353DD23554101CAFD4 47190711 C865CAA0A54542333929B29B116F4375 7D7F65DCD99003C0A0D5D31CA3E5253E 5B27983AF628FC3FCB36B89300012944
```
Here's my subscriber information from above.
@ -229,8 +229,8 @@ Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml.old 2020-08-22 12:07:32.755250028 -0400
+++ mme.yaml 2020-08-22 12:08:17.309320211 -0400
--- mme.yaml.old 2020-08-22 12:07:32.755250028 -0400
+++ mme.yaml 2020-08-22 12:08:17.309320211 -0400
@@ -208,20 +208,20 @@
mme:
freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
@ -263,8 +263,8 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
```diff
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml.old 2020-08-22 12:08:44.782880778 -0400
+++ sgwu.yaml 2020-08-22 12:06:49.809299514 -0400
--- sgwu.yaml.old 2020-08-22 12:08:44.782880778 -0400
+++ sgwu.yaml 2020-08-22 12:06:49.809299514 -0400
@@ -82,7 +82,7 @@
#
sgwu:
@ -338,8 +338,8 @@ You should check your phone frequency. If your phone does not support Band-3, yo
```diff
$ diff -u enb.conf.example enb.conf
-- enb.conf.example 2022-01-19 20:30:13.612993155 +0900
+++ enb.conf 2022-01-19 21:04:15.674419300 +0900
-- enb.conf.example 2022-01-19 20:30:13.612993155 +0900
+++ enb.conf 2022-01-19 21:04:15.674419300 +0900
@@ -20,9 +20,9 @@
#####################################################################
[enb]
@ -375,8 +375,8 @@ $ diff -u enb.conf.example enb.conf
```diff
$ diff -u rr.conf.example rr.conf
-- rr.conf.example 2022-01-19 20:30:13.620992794 +0900
+++ rr.conf 2022-01-19 21:05:21.959044145 +0900
-- rr.conf.example 2022-01-19 20:30:13.620992794 +0900
+++ rr.conf 2022-01-19 21:05:21.959044145 +0900
@@ -55,10 +55,10 @@
{
// rf_port = 0;
@ -409,8 +409,8 @@ Device Argument : Clock source from external GPS-DO
If you are not using GPS-DO, you can just comment out `device_args` as shown below.
```diff
$ diff -u enb.conf enb.conf.no_gps_do
--- enb.conf 2022-01-19 21:08:32.941527373 +0900
+++ enb.conf.no_gps_do 2022-01-19 21:10:18.612581261 +0900
--- enb.conf 2022-01-19 21:08:32.941527373 +0900
+++ enb.conf.no_gps_do 2022-01-19 21:10:18.612581261 +0900
@@ -81,7 +81,7 @@
# Example for ZMQ-based operation with TCP transport for I/Q samples

View File

@ -307,9 +307,9 @@ Username: test
Password: testpasswd
Server: ims.mnc001.mcc001.3gppnetwork.org (Created DNS Domain Name or IP to which IMS components are bound to, visible interface IP address)
Optional Settings:
Authentication username: test
Outbound proxy address: 172.24.15.30 (Floating IP of VM in case of OpenStack or else no need to fill in case of physical machine)
Transport type: UDP
Authentication username: test
Outbound proxy address: 172.24.15.30 (Floating IP of VM in case of OpenStack or else no need to fill in case of physical machine)
Transport type: UDP
```
In Phone 2:
@ -319,9 +319,9 @@ Username: test2
Password: testpasswd
Server: ims.mnc001.mcc001.3gppnetwork.org (Created DNS Domain Name or IP to which IMS components are bound to, visible interface IP address)
Optional Settings:
Authentication username: test2
Outbound proxy address: 172.24.15.30 (Floating IP of VM in case of OpenStack or else no need to fill in case of physical machine)
Transport type: UDP
Authentication username: test2
Outbound proxy address: 172.24.15.30 (Floating IP of VM in case of OpenStack or else no need to fill in case of physical machine)
Transport type: UDP
```
- Set "Receive incoming calls" option to enabled state in both phones
@ -566,8 +566,8 @@ options {
// the all-0's placeholder.
//forwarders {
// Put here the IP address of other DNS server which could be used if name cannot be resolved with DNS server running in this machine (Optional)
//10.4.128.2;
// Put here the IP address of other DNS server which could be used if name cannot be resolved with DNS server running in this machine (Optional)
//10.4.128.2;
//};
//========================================================================
@ -1068,8 +1068,8 @@ In the below example. epc-ims is the hostname of the machine
```
root@epc-ims:~# cat /etc/hosts
127.0.0.1 localhost
127.0.0.1 epc-ims
127.0.0.1 localhost
127.0.0.1 epc-ims
```
#### 20. Add IMS subscription use in FoHSS as follows from the Web GUI
@ -1078,7 +1078,7 @@ Assuming IMSI of the user as 001010123456791 and MSISDN is 0198765432100
```
Login to the HSS web console.
Navigate to the User Identities page
Navigate to the User Identities page
Create the IMSU
Click IMS Subscription / Create
Enter:

View File

@ -24,7 +24,7 @@
char *ogs_strerror(ogs_err_t err, char *buf, size_t size)
{
#if defined(_WIN32)
/*
/*
* The following code is stolen from APR Library
* http://svn.apache.org/repos/asf/apr/apr/trunk/misc/unix/errorcodes.c
*/

View File

@ -52,8 +52,8 @@ const ogs_pollset_actions_t ogs_kqueue_actions = {
struct kqueue_context_s {
int kqueue;
struct kevent *change_list;
struct kevent *event_list;
struct kevent *change_list;
struct kevent *event_list;
int nchanges, nevents;
};
@ -66,12 +66,12 @@ static void kqueue_init(ogs_pollset_t *pollset)
ogs_assert(context);
pollset->context = context;
context->change_list = ogs_calloc(
context->change_list = ogs_calloc(
pollset->capacity, sizeof(struct kevent));
ogs_assert(context->change_list);
context->event_list = ogs_calloc(
context->event_list = ogs_calloc(
pollset->capacity, sizeof(struct kevent));
ogs_assert(context->change_list);
ogs_assert(context->change_list);
context->nchanges = 0;
context->nevents = pollset->capacity;
@ -89,8 +89,8 @@ static void kqueue_cleanup(ogs_pollset_t *pollset)
context = pollset->context;
ogs_assert(context);
ogs_free(context->change_list);
ogs_free(context->event_list);
ogs_free(context->change_list);
ogs_free(context->event_list);
close(context->kqueue);
@ -215,75 +215,75 @@ static int kqueue_process(ogs_pollset_t *pollset, ogs_time_t timeout)
return OGS_TIMEUP;
}
for (i = 0; i < n; i++) {
for (i = 0; i < n; i++) {
ogs_poll_t *poll = NULL;
short when = 0;
if (context->event_list[i].flags & EV_ERROR) {
switch (context->event_list[i].data) {
switch (context->event_list[i].data) {
/* Can occur on delete if we are not currently
* watching any events on this fd. That can
* happen when the fd was closed and another
* file was opened with that fd. */
case ENOENT:
/* Can occur for reasons not fully understood
* on FreeBSD. */
case EINVAL:
continue;
/* Can occur on delete if we are not currently
* watching any events on this fd. That can
* happen when the fd was closed and another
* file was opened with that fd. */
case ENOENT:
/* Can occur for reasons not fully understood
* on FreeBSD. */
case EINVAL:
continue;
#if defined(__FreeBSD__)
/*
* This currently occurs if an FD is closed
* before the EV_DELETE makes it out via kevent().
* The FreeBSD capabilities code sees the blank
* capability set and rejects the request to
* modify an event.
*
* To be strictly correct - when an FD is closed,
* all the registered events are also removed.
* Queuing EV_DELETE to a closed FD is wrong.
* The event(s) should just be deleted from
* the pending changelist.
*/
case ENOTCAPABLE:
continue;
/*
* This currently occurs if an FD is closed
* before the EV_DELETE makes it out via kevent().
* The FreeBSD capabilities code sees the blank
* capability set and rejects the request to
* modify an event.
*
* To be strictly correct - when an FD is closed,
* all the registered events are also removed.
* Queuing EV_DELETE to a closed FD is wrong.
* The event(s) should just be deleted from
* the pending changelist.
*/
case ENOTCAPABLE:
continue;
#endif
/* Can occur on a delete if the fd is closed. */
case EBADF:
/* XXXX On NetBSD, we can also get EBADF if we
* try to add the write side of a pipe, but
* the read side has already been closed.
* Other BSDs call this situation 'EPIPE'. It
* would be good if we had a way to report
* this situation. */
continue;
/* These two can occur on an add if the fd was one side
* of a pipe, and the other side was closed. */
case EPERM:
case EPIPE:
/* Report read events, if we're listening for
* them, so that the user can learn about any
* add errors. (If the operation was a
* delete, then udata should be cleared.) */
if (context->event_list[i].udata) {
/* The operation was an add:
* report the error as a read. */
when |= OGS_POLLIN;
break;
} else {
/* The operation was a del:
* report nothing. */
continue;
}
/* Can occur on a delete if the fd is closed. */
case EBADF:
/* XXXX On NetBSD, we can also get EBADF if we
* try to add the write side of a pipe, but
* the read side has already been closed.
* Other BSDs call this situation 'EPIPE'. It
* would be good if we had a way to report
* this situation. */
continue;
/* These two can occur on an add if the fd was one side
* of a pipe, and the other side was closed. */
case EPERM:
case EPIPE:
/* Report read events, if we're listening for
* them, so that the user can learn about any
* add errors. (If the operation was a
* delete, then udata should be cleared.) */
if (context->event_list[i].udata) {
/* The operation was an add:
* report the error as a read. */
when |= OGS_POLLIN;
break;
} else {
/* The operation was a del:
* report nothing. */
continue;
}
/* Other errors shouldn't occur. */
default:
/* Other errors shouldn't occur. */
default:
ogs_error("kevent() error : flags = 0x%x, errno = %d",
context->event_list[i].flags,
(int)context->event_list[i].data);
return OGS_ERROR;
}
return OGS_ERROR;
}
} else if (context->event_list[i].filter == EVFILT_READ) {
when |= OGS_POLLIN;
} else if (context->event_list[i].filter == EVFILT_WRITE) {
@ -316,7 +316,7 @@ static void kqueue_notify_init(ogs_pollset_t *pollset)
int rc;
struct kqueue_context_s *context = NULL;
struct kevent kev;
struct timespec timeout = { 0, 0 };
struct timespec timeout = { 0, 0 };
ogs_assert(pollset);
ogs_assert(pollset);
@ -325,8 +325,8 @@ static void kqueue_notify_init(ogs_pollset_t *pollset)
memset(&kev, 0, sizeof kev);
kev.ident = NOTIFY_IDENT;
kev.filter = EVFILT_USER;
kev.flags = EV_ADD | EV_CLEAR;
kev.filter = EVFILT_USER;
kev.flags = EV_ADD | EV_CLEAR;
rc = kevent(context->kqueue, &kev, 1, NULL, 0, &timeout);
ogs_assert(rc != -1);
@ -337,7 +337,7 @@ static int kqueue_notify_pollset(ogs_pollset_t *pollset)
int rc;
struct kqueue_context_s *context = NULL;
struct kevent kev;
struct timespec timeout = { 0, 0 };
struct timespec timeout = { 0, 0 };
ogs_assert(pollset);
ogs_assert(pollset);
@ -346,8 +346,8 @@ static int kqueue_notify_pollset(ogs_pollset_t *pollset)
memset(&kev, 0, sizeof kev);
kev.ident = NOTIFY_IDENT;
kev.filter = EVFILT_USER;
kev.fflags = NOTE_TRIGGER;
kev.filter = EVFILT_USER;
kev.fflags = NOTE_TRIGGER;
rc = kevent(context->kqueue, &kev, 1, NULL, 0, &timeout);
if (rc == -1) {

View File

@ -79,7 +79,7 @@ void ogs_random(void *buf, size_t buflen)
fd = -1; /* force open() again */
}
else {
buf = (unsigned char *)buf + rc;
buf = (unsigned char *)buf + rc;
buflen -= rc;
}
} while (buflen > 0);
@ -123,7 +123,7 @@ void *(*volatile evutil_memset_volatile_)(void *, int, size_t) = memset;
static void evutil_memclear_(void *mem, size_t len)
{
evutil_memset_volatile_(mem, 0, len);
evutil_memset_volatile_(mem, 0, len);
}
#include "arc4random.c"

View File

@ -369,7 +369,7 @@ int ogs_signal_thread(int(*signal_handler)(int signum))
return OGS_OK;
}
#elif HAVE_SIGSUSPEND
sigsuspend(&sig_mask);
sigsuspend(&sig_mask);
#else
#error No sigwait() and no sigsuspend()
#endif

View File

@ -255,23 +255,23 @@ int ogs_sortaddrinfo(ogs_sockaddr_t **sa_list, int family)
ogs_sockaddr_t *ogs_link_local_addr(const char *dev, const ogs_sockaddr_t *sa)
{
#if defined(HAVE_GETIFADDRS)
struct ifaddrs *iflist, *cur;
struct ifaddrs *iflist, *cur;
int rc;
rc = getifaddrs(&iflist);
rc = getifaddrs(&iflist);
if (rc != 0) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "getifaddrs failed");
return NULL;
}
for (cur = iflist; cur != NULL; cur = cur->ifa_next) {
for (cur = iflist; cur != NULL; cur = cur->ifa_next) {
ogs_sockaddr_t *ifa_addr = NULL;
ogs_sockaddr_t *addr = NULL;
ifa_addr = (ogs_sockaddr_t *)cur->ifa_addr;
if (ifa_addr == NULL) /* may happen with ppp interfaces */
continue;
if (ifa_addr == NULL) /* may happen with ppp interfaces */
continue;
if (ifa_addr->ogs_sa_family == AF_INET)
continue;
@ -293,9 +293,9 @@ ogs_sockaddr_t *ogs_link_local_addr(const char *dev, const ogs_sockaddr_t *sa)
freeifaddrs(iflist);
return addr;
}
}
freeifaddrs(iflist);
freeifaddrs(iflist);
#endif
return NULL;
}

View File

@ -112,16 +112,16 @@ int ogs_socknode_probe(ogs_list_t *list, ogs_list_t *list6,
{
#if defined(HAVE_GETIFADDRS)
ogs_socknode_t *node = NULL;
struct ifaddrs *iflist, *cur;
struct ifaddrs *iflist, *cur;
int rc;
rc = getifaddrs(&iflist);
rc = getifaddrs(&iflist);
if (rc != 0) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "getifaddrs failed");
return OGS_ERROR;
}
for (cur = iflist; cur != NULL; cur = cur->ifa_next) {
for (cur = iflist; cur != NULL; cur = cur->ifa_next) {
ogs_sockaddr_t *addr = NULL;
if (cur->ifa_flags & IFF_LOOPBACK)
@ -130,8 +130,8 @@ int ogs_socknode_probe(ogs_list_t *list, ogs_list_t *list6,
if (cur->ifa_flags & IFF_POINTOPOINT)
continue;
if (cur->ifa_addr == NULL) /* may happen with ppp interfaces */
continue;
if (cur->ifa_addr == NULL) /* may happen with ppp interfaces */
continue;
if (dev && strcmp(dev, cur->ifa_name) != 0)
continue;
@ -185,9 +185,9 @@ int ogs_socknode_probe(ogs_list_t *list, ogs_list_t *list6,
if (option)
node->option = ogs_memdup(option, sizeof *option);
}
}
freeifaddrs(iflist);
freeifaddrs(iflist);
return OGS_OK;
#elif defined(_WIN32)
return OGS_OK;
@ -202,7 +202,7 @@ int ogs_socknode_probe(ogs_list_t *list, ogs_list_t *list6,
int ogs_socknode_fill_scope_id_in_local(ogs_sockaddr_t *sa_list)
{
#if defined(HAVE_GETIFADDRS)
struct ifaddrs *iflist = NULL, *cur;
struct ifaddrs *iflist = NULL, *cur;
int rc;
ogs_sockaddr_t *addr, *ifaddr;

View File

@ -78,18 +78,18 @@ int ogs_gettimeofday(struct timeval *tv)
#else
#define DELTA_EPOCH_IN_MICROSEC 11644473600000000ULL
#endif
FILETIME ft;
uint64_t tmp = 0;
FILETIME ft;
uint64_t tmp = 0;
/*
* The const value is shamelessy stolen from
* http://www.boost.org/doc/libs/1_55_0/boost/chrono/detail/inlined/win/chrono.hpp
*
* File times are the number of 100 nanosecond intervals elapsed since
* 12:00 am Jan 1, 1601 UTC. I haven't check the math particularly hard
*
* ... good luck
*/
/*
* The const value is shamelessy stolen from
* http://www.boost.org/doc/libs/1_55_0/boost/chrono/detail/inlined/win/chrono.hpp
*
* File times are the number of 100 nanosecond intervals elapsed since
* 12:00 am Jan 1, 1601 UTC. I haven't check the math particularly hard
*
* ... good luck
*/
if (tv) {
GetSystemTimeAsFileTime (&ft);
@ -182,7 +182,7 @@ int ogs_time_from_gmt(ogs_time_t *t, struct tm *tm, int tm_usec)
*/
uint32_t ogs_time_ntp32_now(void)
{
int rc;
int rc;
struct timeval tv;
rc = ogs_gettimeofday(&tv);
@ -192,13 +192,13 @@ uint32_t ogs_time_ntp32_now(void)
}
ogs_time_t ogs_time_from_ntp32(uint32_t ntp_timestamp)
{
if (ntp_timestamp < OGS_1970_1900_SEC_DIFF)
return 0;
return (ntp_timestamp - OGS_1970_1900_SEC_DIFF) * OGS_USEC_PER_SEC;
if (ntp_timestamp < OGS_1970_1900_SEC_DIFF)
return 0;
return (ntp_timestamp - OGS_1970_1900_SEC_DIFF) * OGS_USEC_PER_SEC;
}
uint32_t ogs_time_to_ntp32(ogs_time_t time)
{
return (time / OGS_USEC_PER_SEC) + OGS_1970_1900_SEC_DIFF;
return (time / OGS_USEC_PER_SEC) + OGS_1970_1900_SEC_DIFF;
}
int ogs_timezone(void)

View File

@ -174,31 +174,31 @@ static int diam_config_apply(ogs_diam_config_t *fd_config)
CHECK_FCT_DO( fd_ext_add( fname, cfname ), return OGS_ERROR );
}
return OGS_OK;
return OGS_OK;
}
int ogs_diam_config_init(ogs_diam_config_t *fd_config)
{
char * buf = NULL, *b;
size_t len = 0;
CHECK_FCT( diam_config_apply(fd_config) );
/* The following module use data from the configuration */
CHECK_FCT( fd_rtdisp_init() );
char * buf = NULL, *b;
size_t len = 0;
CHECK_FCT( diam_config_apply(fd_config) );
/* The following module use data from the configuration */
CHECK_FCT( fd_rtdisp_init() );
/* Now, load all dynamic extensions */
CHECK_FCT( fd_ext_load() );
/* Display configuration */
b = fd_conf_dump(&buf, &len, NULL);
/* Display configuration */
b = fd_conf_dump(&buf, &len, NULL);
LOG_SPLIT(FD_LOG_NOTICE, NULL,
b ?: (char*)"<Error during configuration dump...>", NULL);
free(buf);
/* Since some extensions might have modified the definitions from the dict_base_protocol, we only load the objects now */
CHECK_FCT( fd_msg_init() );
free(buf);
/* Since some extensions might have modified the definitions from the dict_base_protocol, we only load the objects now */
CHECK_FCT( fd_msg_init() );
return OGS_OK;
}

View File

@ -44,7 +44,7 @@ int ogs_diam_init(int mode, const char *conffile, ogs_diam_config_t *fd_config)
return ret;
}
/* Parse the configuration file */
/* Parse the configuration file */
if (conffile) {
CHECK_FCT_DO( fd_core_parseconf(conffile), goto error );
} else {
@ -59,35 +59,35 @@ int ogs_diam_init(int mode, const char *conffile, ogs_diam_config_t *fd_config)
return 0;
error:
CHECK_FCT_DO( fd_core_shutdown(), );
CHECK_FCT_DO( fd_core_wait_shutdown_complete(), );
CHECK_FCT_DO( fd_core_shutdown(), );
CHECK_FCT_DO( fd_core_wait_shutdown_complete(), );
return -1;
return -1;
}
int ogs_diam_start(void)
{
/* Start the servers */
CHECK_FCT_DO( fd_core_start(), goto error );
/* Start the servers */
CHECK_FCT_DO( fd_core_start(), goto error );
CHECK_FCT_DO( fd_core_waitstartcomplete(), goto error );
CHECK_FCT_DO( fd_core_waitstartcomplete(), goto error );
CHECK_FCT( ogs_diam_logger_stats_start() );
return 0;
error:
CHECK_FCT_DO( fd_core_shutdown(), );
CHECK_FCT_DO( fd_core_wait_shutdown_complete(), );
CHECK_FCT_DO( fd_core_shutdown(), );
CHECK_FCT_DO( fd_core_wait_shutdown_complete(), );
return -1;
return -1;
}
void ogs_diam_final()
{
ogs_diam_logger_final();
CHECK_FCT_DO( fd_core_shutdown(), ogs_error("fd_core_shutdown() failed") );
CHECK_FCT_DO( fd_core_wait_shutdown_complete(),
CHECK_FCT_DO( fd_core_shutdown(), ogs_error("fd_core_shutdown() failed") );
CHECK_FCT_DO( fd_core_wait_shutdown_complete(),
ogs_error("fd_core_wait_shutdown_complete() failed"));
}

View File

@ -34,27 +34,27 @@ static void * diam_stats_worker(void * arg);
int ogs_diam_logger_init(int mode)
{
uint32_t mask_peers = HOOK_MASK( HOOK_PEER_CONNECT_SUCCESS );
uint32_t mask_peers = HOOK_MASK( HOOK_PEER_CONNECT_SUCCESS );
memset(&self, 0, sizeof(struct ogs_diam_logger_t));
self.mode = mode;
self.duration = 60; /* 60 seconds */
self.duration = 60; /* 60 seconds */
CHECK_FCT( fd_hook_register(
mask_peers, ogs_diam_logger_cb, NULL, NULL, &logger_hdl) );
CHECK_POSIX( pthread_mutex_init(&self.stats_lock, NULL) );
CHECK_POSIX( pthread_mutex_init(&self.stats_lock, NULL) );
return 0;
return 0;
}
void ogs_diam_logger_final()
{
CHECK_FCT_DO( fd_thr_term(&fd_stats_th), );
CHECK_POSIX_DO( pthread_mutex_destroy(&self.stats_lock), );
CHECK_FCT_DO( fd_thr_term(&fd_stats_th), );
CHECK_POSIX_DO( pthread_mutex_destroy(&self.stats_lock), );
if (logger_hdl) { CHECK_FCT_DO( fd_hook_unregister( logger_hdl ), ); }
if (logger_hdl) { CHECK_FCT_DO( fd_hook_unregister( logger_hdl ), ); }
}
struct ogs_diam_logger_t* ogs_diam_logger_self()
@ -64,8 +64,8 @@ struct ogs_diam_logger_t* ogs_diam_logger_self()
int ogs_diam_logger_stats_start()
{
/* Start the statistics thread */
CHECK_POSIX( pthread_create(&fd_stats_th, NULL, diam_stats_worker, NULL) );
/* Start the statistics thread */
CHECK_POSIX( pthread_create(&fd_stats_th, NULL, diam_stats_worker, NULL) );
return 0;
}
@ -85,74 +85,74 @@ static void ogs_diam_logger_cb(enum fd_hook_type type, struct msg * msg,
struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd,
void * regdata)
{
const char * peer_name = peer ? peer->info.pi_diamid : "<unknown peer>";
CHECK_POSIX_DO( pthread_mutex_lock(&mtx), );
const char * peer_name = peer ? peer->info.pi_diamid : "<unknown peer>";
CHECK_POSIX_DO( pthread_mutex_lock(&mtx), );
if (user_handler)
{
user_handler(type, msg, peer, other, pmd, regdata);
}
switch (type) {
switch (type) {
/* peers */
case HOOK_PEER_CONNECT_SUCCESS:
{
char protobuf[40];
if (peer) {
CHECK_FCT_DO(fd_peer_cnx_proto_info(peer, protobuf, sizeof(protobuf)), break );
} else {
protobuf[0] = '-';
protobuf[1] = '\0';
}
ogs_info("CONNECTED TO '%s' (%s):", peer_name, protobuf);
}
break;
case HOOK_PEER_CONNECT_SUCCESS:
{
char protobuf[40];
if (peer) {
CHECK_FCT_DO(fd_peer_cnx_proto_info(peer, protobuf, sizeof(protobuf)), break );
} else {
protobuf[0] = '-';
protobuf[1] = '\0';
}
ogs_info("CONNECTED TO '%s' (%s):", peer_name, protobuf);
}
break;
default:
ogs_warn("Unknown type(%d)", type);
break;
}
CHECK_POSIX_DO( pthread_mutex_unlock(&mtx), );
break;
}
CHECK_POSIX_DO( pthread_mutex_unlock(&mtx), );
}
/* Function to display statistics periodically */
static void * diam_stats_worker(void * arg)
{
struct timespec start, now;
struct fd_stats copy;
/* Get the start time */
CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &start), );
/* Now, loop until canceled */
while (1) {
/* Display statistics every XX seconds */
sleep(self.duration);
/* Now, get the current stats */
CHECK_POSIX_DO( pthread_mutex_lock(&self.stats_lock), );
memcpy(&copy, &self.stats, sizeof(struct fd_stats));
CHECK_POSIX_DO( pthread_mutex_unlock(&self.stats_lock), );
/* Get the current execution time */
CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &now), );
/* Now, display everything */
ogs_trace("------- fd statistics ---------");
if (now.tv_nsec >= start.tv_nsec)
struct timespec start, now;
struct fd_stats copy;
/* Get the start time */
CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &start), );
/* Now, loop until canceled */
while (1) {
/* Display statistics every XX seconds */
sleep(self.duration);
/* Now, get the current stats */
CHECK_POSIX_DO( pthread_mutex_lock(&self.stats_lock), );
memcpy(&copy, &self.stats, sizeof(struct fd_stats));
CHECK_POSIX_DO( pthread_mutex_unlock(&self.stats_lock), );
/* Get the current execution time */
CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &now), );
/* Now, display everything */
ogs_trace("------- fd statistics ---------");
if (now.tv_nsec >= start.tv_nsec)
{
ogs_trace(" Executing for: %d.%06ld sec",
(int)(now.tv_sec - start.tv_sec),
(long)(now.tv_nsec - start.tv_nsec) / 1000);
}
ogs_trace(" Executing for: %d.%06ld sec",
(int)(now.tv_sec - start.tv_sec),
(long)(now.tv_nsec - start.tv_nsec) / 1000);
}
else
{
ogs_trace(" Executing for: %d.%06ld sec",
(int)(now.tv_sec - 1 - start.tv_sec),
(long)(now.tv_nsec + 1000000000 - start.tv_nsec) / 1000);
}
ogs_trace(" Executing for: %d.%06ld sec",
(int)(now.tv_sec - 1 - start.tv_sec),
(long)(now.tv_nsec + 1000000000 - start.tv_nsec) / 1000);
}
if (self.mode & FD_MODE_SERVER) {
ogs_trace(" Server: %llu message(s) echoed",
copy.nb_echoed);
@ -169,9 +169,9 @@ static void * diam_stats_worker(void * arg)
ogs_trace(" Average: %ld.%06ld sec.",
copy.avg / 1000000, copy.avg % 1000000);
}
ogs_trace("-------------------------------------");
}
return NULL; /* never called */
ogs_trace("-------------------------------------");
}
return NULL; /* never called */
}

View File

@ -19,8 +19,8 @@
#include "ogs-diameter-common.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_session_id = NULL;
struct dict_object *ogs_diam_termination_cause = NULL;
@ -107,17 +107,17 @@ int ogs_diam_message_session_id_set(
struct avp *avp;
union avp_value val;
/* Create an AVP to hold it */
CHECK_FCT( fd_msg_avp_new( ogs_diam_session_id, 0, &avp ) );
/* Create an AVP to hold it */
CHECK_FCT( fd_msg_avp_new( ogs_diam_session_id, 0, &avp ) );
/* Set its value */
memset(&val, 0, sizeof(val));
val.os.data = sid;
val.os.len = sidlen;
CHECK_FCT( fd_msg_avp_setvalue( avp, &val ) );
/* Set its value */
memset(&val, 0, sizeof(val));
val.os.data = sid;
val.os.len = sidlen;
CHECK_FCT( fd_msg_avp_setvalue( avp, &val ) );
/* Add it to the message */
CHECK_FCT( fd_msg_avp_add( msg, MSG_BRW_FIRST_CHILD, avp ) );
/* Add it to the message */
CHECK_FCT( fd_msg_avp_add( msg, MSG_BRW_FIRST_CHILD, avp ) );
return 0;
}

View File

@ -24,7 +24,7 @@ bool ogs_diam_app_connected(uint32_t app_id)
struct fd_list *li = NULL;
struct fd_app *found = NULL;
CHECK_POSIX( pthread_rwlock_rdlock(&fd_g_peers_rw) );
CHECK_POSIX( pthread_rwlock_rdlock(&fd_g_peers_rw) );
for (li = fd_g_peers.next; li != &fd_g_peers; li = li->next) {
struct peer_hdr *p = (struct peer_hdr *)li->o;
int state = fd_peer_get_state(p);
@ -44,7 +44,7 @@ bool ogs_diam_app_connected(uint32_t app_id)
ogs_debug("'%s' STATE[%d] is NOT open ", p->info.pi_diamid, state);
}
}
CHECK_POSIX( pthread_rwlock_unlock(&fd_g_peers_rw) );
CHECK_POSIX( pthread_rwlock_unlock(&fd_g_peers_rw) );
if (found)
return true;

View File

@ -19,8 +19,8 @@
#include "ogs-diameter-cx.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_cx_application = NULL;

View File

@ -19,8 +19,8 @@
#include "ogs-diameter-gx.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_gx_application = NULL;
@ -113,19 +113,19 @@ int ogs_diam_gx_init(void)
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IPv6-Prefix", &ogs_diam_gx_framed_ipv6_prefix);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "IP-CAN-Type", &ogs_diam_gx_ip_can_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Information", &ogs_diam_gx_qos_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Class-Identifier" , &ogs_diam_gx_qos_class_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_gx_max_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL" , &ogs_diam_gx_max_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-UL" , &ogs_diam_gx_min_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-DL" , &ogs_diam_gx_min_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-UL" , &ogs_diam_gx_guaranteed_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-DL" , &ogs_diam_gx_guaranteed_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Allocation-Retention-Priority" , &ogs_diam_gx_allocation_retention_priority);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Class-Identifier" , &ogs_diam_gx_qos_class_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_gx_max_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL" , &ogs_diam_gx_max_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-UL" , &ogs_diam_gx_min_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-DL" , &ogs_diam_gx_min_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-UL" , &ogs_diam_gx_guaranteed_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-DL" , &ogs_diam_gx_guaranteed_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Allocation-Retention-Priority" , &ogs_diam_gx_allocation_retention_priority);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Priority-Level", &ogs_diam_gx_priority_level);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Capability", &ogs_diam_gx_pre_emption_capability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Vulnerability", &ogs_diam_gx_pre_emption_vulnerability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-UL" , &ogs_diam_gx_apn_aggregate_max_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-DL" , &ogs_diam_gx_apn_aggregate_max_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-UL" , &ogs_diam_gx_apn_aggregate_max_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-DL" , &ogs_diam_gx_apn_aggregate_max_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-User-Location-Info", &ogs_diam_gx_3gpp_user_location_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Called-Station-Id", &ogs_diam_gx_called_station_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Default-EPS-Bearer-QoS", &ogs_diam_gx_default_eps_bearer_qos);
@ -150,8 +150,8 @@ int ogs_diam_gx_init(void)
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Description", &ogs_diam_gx_media_component_description);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Number", &ogs_diam_gx_media_component_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Type", &ogs_diam_gx_media_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RR-Bandwidth" , &ogs_diam_gx_rr_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RS-Bandwidth" , &ogs_diam_gx_rs_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RR-Bandwidth" , &ogs_diam_gx_rr_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RS-Bandwidth" , &ogs_diam_gx_rs_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Codec-Data", &ogs_diam_gx_codec_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Sub-Component", &ogs_diam_gx_media_sub_component);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Number", &ogs_diam_gx_flow_number);

View File

@ -20,8 +20,8 @@
#include "ogs-diameter-gy.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_gy_application = NULL;
@ -86,70 +86,70 @@ extern int ogs_dict_gy_entry(char *conffile);
int ogs_diam_gy_init(void)
{
application_id_t id = OGS_DIAM_GY_APPLICATION_ID;
application_id_t id = OGS_DIAM_GY_APPLICATION_ID;
ogs_assert(ogs_dict_gy_entry(NULL) == 0);
ogs_assert(ogs_dict_gy_entry(NULL) == 0);
CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID, (void *)&id, &ogs_diam_gy_application);
CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID, (void *)&id, &ogs_diam_gy_application);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Request", &ogs_diam_gy_cmd_ccr);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Answer", &ogs_diam_gy_cmd_cca);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Request", &ogs_diam_gy_cmd_rar);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Answer", &ogs_diam_gy_cmd_raa);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Request", &ogs_diam_gy_cmd_ccr);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Answer", &ogs_diam_gy_cmd_cca);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Request", &ogs_diam_gy_cmd_rar);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Answer", &ogs_diam_gy_cmd_raa);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Type", &ogs_diam_gy_cc_request_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Number", &ogs_diam_gy_cc_request_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Requested-Action", &ogs_diam_gy_requested_action);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AoC-Request-Type", &ogs_diam_gy_aoc_request_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Multiple-Services-Indicator", &ogs_diam_gy_multiple_services_ind);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Multiple-Services-Credit-Control", &ogs_diam_gy_multiple_services_cc);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Requested-Service-Unit", &ogs_diam_gy_requested_service_unit);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Used-Service-Unit", &ogs_diam_gy_used_service_unit);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Time", &ogs_diam_gy_cc_time);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Total-Octets", &ogs_diam_gy_cc_total_octets);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Input-Octets", &ogs_diam_gy_cc_input_octets);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Output-Octets", &ogs_diam_gy_cc_output_octets);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Service-Specific-Units", &ogs_diam_gy_cc_service_specific_units);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Reporting-Reason", &ogs_diam_gy_reporting_reason);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Service-Identifier", &ogs_diam_gy_service_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Type", &ogs_diam_gy_cc_request_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Number", &ogs_diam_gy_cc_request_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Requested-Action", &ogs_diam_gy_requested_action);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AoC-Request-Type", &ogs_diam_gy_aoc_request_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Multiple-Services-Indicator", &ogs_diam_gy_multiple_services_ind);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Multiple-Services-Credit-Control", &ogs_diam_gy_multiple_services_cc);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Requested-Service-Unit", &ogs_diam_gy_requested_service_unit);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Used-Service-Unit", &ogs_diam_gy_used_service_unit);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Time", &ogs_diam_gy_cc_time);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Total-Octets", &ogs_diam_gy_cc_total_octets);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Input-Octets", &ogs_diam_gy_cc_input_octets);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Output-Octets", &ogs_diam_gy_cc_output_octets);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Service-Specific-Units", &ogs_diam_gy_cc_service_specific_units);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Reporting-Reason", &ogs_diam_gy_reporting_reason);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Service-Identifier", &ogs_diam_gy_service_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Service-Information", &ogs_diam_gy_service_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "PS-Information", &ogs_diam_gy_ps_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-Charging-Id", &ogs_diam_gy_3gpp_charging_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-PDP-Type", &ogs_diam_gy_3gpp_pdp_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "PDP-Address", &ogs_diam_gy_pdp_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "SGSN-Address", &ogs_diam_gy_sgsn_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "GGSN-Address", &ogs_diam_gy_ggsn_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-NSAPI", &ogs_diam_gy_3gpp_nsapi);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-Selection-Mode", &ogs_diam_gy_3gpp_selection_mode);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-Charging-Characteristics", &ogs_diam_gy_3gpp_charging_characteristics);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "User-Equipment-Info", &ogs_diam_gy_user_equipment_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "User-Equipment-Info-Type", &ogs_diam_gy_user_equipment_info_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "User-Equipment-Info-Value", &ogs_diam_gy_user_equipment_info_value);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Service-Information", &ogs_diam_gy_service_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "PS-Information", &ogs_diam_gy_ps_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-Charging-Id", &ogs_diam_gy_3gpp_charging_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-PDP-Type", &ogs_diam_gy_3gpp_pdp_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "PDP-Address", &ogs_diam_gy_pdp_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "SGSN-Address", &ogs_diam_gy_sgsn_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "GGSN-Address", &ogs_diam_gy_ggsn_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-NSAPI", &ogs_diam_gy_3gpp_nsapi);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-Selection-Mode", &ogs_diam_gy_3gpp_selection_mode);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-Charging-Characteristics", &ogs_diam_gy_3gpp_charging_characteristics);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "User-Equipment-Info", &ogs_diam_gy_user_equipment_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "User-Equipment-Info-Type", &ogs_diam_gy_user_equipment_info_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "User-Equipment-Info-Value", &ogs_diam_gy_user_equipment_info_value);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List-ID", &ogs_diam_gy_feature_list_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List", &ogs_diam_gy_feature_list);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Information", &ogs_diam_gy_qos_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Class-Identifier" , &ogs_diam_gy_qos_class_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_gy_max_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL" , &ogs_diam_gy_max_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-UL" , &ogs_diam_gy_guaranteed_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-DL" , &ogs_diam_gy_guaranteed_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Allocation-Retention-Priority" , &ogs_diam_gy_allocation_retention_priority);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Priority-Level", &ogs_diam_gy_priority_level);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Capability", &ogs_diam_gy_pre_emption_capability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Vulnerability", &ogs_diam_gy_pre_emption_vulnerability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-UL" , &ogs_diam_gy_apn_aggregate_max_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-DL" , &ogs_diam_gy_apn_aggregate_max_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-RAT-Type" , &ogs_diam_gy_3gpp_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-User-Location-Info", &ogs_diam_gy_3gpp_user_location_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Called-Station-Id", &ogs_diam_gy_called_station_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-MS-TimeZone", &ogs_diam_gy_3gpp_ms_timezone);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List-ID", &ogs_diam_gy_feature_list_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List", &ogs_diam_gy_feature_list);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Information", &ogs_diam_gy_qos_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Class-Identifier" , &ogs_diam_gy_qos_class_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_gy_max_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL" , &ogs_diam_gy_max_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-UL" , &ogs_diam_gy_guaranteed_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-DL" , &ogs_diam_gy_guaranteed_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Allocation-Retention-Priority" , &ogs_diam_gy_allocation_retention_priority);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Priority-Level", &ogs_diam_gy_priority_level);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Capability", &ogs_diam_gy_pre_emption_capability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Vulnerability", &ogs_diam_gy_pre_emption_vulnerability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-UL" , &ogs_diam_gy_apn_aggregate_max_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-DL" , &ogs_diam_gy_apn_aggregate_max_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-RAT-Type" , &ogs_diam_gy_3gpp_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-User-Location-Info", &ogs_diam_gy_3gpp_user_location_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Called-Station-Id", &ogs_diam_gy_called_station_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-MS-TimeZone", &ogs_diam_gy_3gpp_ms_timezone);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Base-Name", &ogs_diam_gy_charging_rule_base_name);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flows", &ogs_diam_gy_flows);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Base-Name", &ogs_diam_gy_charging_rule_base_name);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flows", &ogs_diam_gy_flows);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-SGSN-MCC-MNC", &ogs_diam_gy_3gpp_sgsn_mcc_mnc);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-SGSN-MCC-MNC", &ogs_diam_gy_3gpp_sgsn_mcc_mnc);
return 0;
return 0;
}

View File

@ -19,8 +19,8 @@
#include "ogs-diameter-rx.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_rx_application = NULL;
@ -78,12 +78,12 @@ int ogs_diam_rx_init(void)
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Description", &ogs_diam_rx_media_component_description);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Number", &ogs_diam_rx_media_component_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Type", &ogs_diam_rx_media_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_rx_max_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL" , &ogs_diam_rx_max_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-UL" , &ogs_diam_rx_min_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-DL" , &ogs_diam_rx_min_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RR-Bandwidth" , &ogs_diam_rx_rr_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RS-Bandwidth" , &ogs_diam_rx_rs_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_rx_max_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL" , &ogs_diam_rx_max_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-UL" , &ogs_diam_rx_min_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-DL" , &ogs_diam_rx_min_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RR-Bandwidth" , &ogs_diam_rx_rr_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RS-Bandwidth" , &ogs_diam_rx_rs_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Status", &ogs_diam_rx_flow_status);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Codec-Data", &ogs_diam_rx_codec_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Sub-Component", &ogs_diam_rx_media_sub_component);

View File

@ -33,62 +33,62 @@
/* The content of this file follows the same structure as dict_base_proto.c */
#define CHECK_dict_new( _type, _data, _parent, _ref ) \
CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) );
#define CHECK_dict_new( _type, _data, _parent, _ref ) \
CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct local_rules_definition {
struct dict_avp_request avp_vendor_plus_name;
enum rule_position position;
int min;
int max;
struct dict_avp_request avp_vendor_plus_name;
enum rule_position position;
int min;
int max;
};
#define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 )
/* Attention! This version of the macro uses AVP_BY_NAME_AND_VENDOR, in contrast to most other copies! */
#define PARSE_loc_rules( _rulearray, _parent) { \
int __ar; \
for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \
struct dict_rule_data __data = { NULL, \
(_rulearray)[__ar].position, \
0, \
(_rulearray)[__ar].min, \
(_rulearray)[__ar].max}; \
__data.rule_order = RULE_ORDER(__data.rule_position); \
CHECK_FCT( fd_dict_search( \
fd_g_config->cnf_dict, \
DICT_AVP, \
AVP_BY_NAME_AND_VENDOR, \
&(_rulearray)[__ar].avp_vendor_plus_name, \
&__data.rule_avp, 0 ) ); \
if ( !__data.rule_avp ) { \
TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return ENOENT; \
} \
CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \
{ \
TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \
(_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return EINVAL; \
} ); \
} \
#define PARSE_loc_rules( _rulearray, _parent) { \
int __ar; \
for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \
struct dict_rule_data __data = { NULL, \
(_rulearray)[__ar].position, \
0, \
(_rulearray)[__ar].min, \
(_rulearray)[__ar].max}; \
__data.rule_order = RULE_ORDER(__data.rule_position); \
CHECK_FCT( fd_dict_search( \
fd_g_config->cnf_dict, \
DICT_AVP, \
AVP_BY_NAME_AND_VENDOR, \
&(_rulearray)[__ar].avp_vendor_plus_name, \
&__data.rule_avp, 0 ) ); \
if ( !__data.rule_avp ) { \
TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return ENOENT; \
} \
CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \
{ \
TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \
(_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return EINVAL; \
} ); \
} \
}
#define enumval_def_u32( _val_, _str_ ) \
{ _str_, { .u32 = _val_ }}
{ _str_, { .u32 = _val_ }}
#define enumval_def_os( _len_, _val_, _str_ ) \
{ _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}}
{ _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}}
int ogs_dict_s6a_entry(char *conffile)
{
struct dict_object *s6a;
TRACE_ENTRY("%p", conffile);
TRACE_ENTRY("%p", conffile);
/* Applications section */
/* Applications section */
{
struct dict_object * vendor;
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_VENDOR, VENDOR_BY_NAME, "3GPP", &vendor, ENOENT));
@ -96,8 +96,8 @@ int ogs_dict_s6a_entry(char *conffile)
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &app_data, vendor, &s6a));
}
/* AVP section */
{
/* AVP section */
{
{
/* AIR-Flags AVP - 3GPP TS 29.272 #7.3.201 */
struct dict_avp_data data = {
@ -111,155 +111,155 @@ int ogs_dict_s6a_entry(char *conffile)
CHECK_dict_new(DICT_AVP, &data, NULL, NULL);
}
/* Terminal Information AVP - 3GPP TS 29.272 #7.3.3 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "IMEI" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP2-MEID" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Software-Version" }, RULE_OPTIONAL, -1, 1 },
};
/* Terminal Information AVP - 3GPP TS 29.272 #7.3.3 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "IMEI" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP2-MEID" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Software-Version" }, RULE_OPTIONAL, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Terminal-Information", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* Requested-EUTRAN-Authentication-Info AVP - 3GPP TS 29.272 #7.3.11 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Number-Of-Requested-Vectors" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Immediate-Response-Preferred" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Re-Synchronization-Info" }, RULE_OPTIONAL, -1, 1 },
};
/* Requested-EUTRAN-Authentication-Info AVP - 3GPP TS 29.272 #7.3.11 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Number-Of-Requested-Vectors" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Immediate-Response-Preferred" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Re-Synchronization-Info" }, RULE_OPTIONAL, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Requested-EUTRAN-Authentication-Info", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* Requested-UTRAN-GERAN-Authentication-Info AVP - 3GPP TS 29.272 #7.3.12 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Number-Of-Requested-Vectors" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Immediate-Response-Preferred" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Re-Synchronization-Info" }, RULE_OPTIONAL, -1, 1 },
};
/* Requested-UTRAN-GERAN-Authentication-Info AVP - 3GPP TS 29.272 #7.3.12 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Number-Of-Requested-Vectors" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Immediate-Response-Preferred" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Re-Synchronization-Info" }, RULE_OPTIONAL, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Requested-UTRAN-GERAN-Authentication-Info", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* E-UTRAN-Vector - 3GPP TS 29.272 #7.3.18 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
/* E-UTRAN-Vector - 3GPP TS 29.272 #7.3.18 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Item-Number" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAND" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "XRES" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "AUTN" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "KASME" }, RULE_REQUIRED, -1, 1 },
};
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "E-UTRAN-Vector", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* UTRAN-Vector - 3GPP TS 29.272 #7.3.19 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
/* UTRAN-Vector - 3GPP TS 29.272 #7.3.19 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Item-Number" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAND" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "XRES" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "AUTN" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Confidentiality-Key" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Integrity-Key" }, RULE_REQUIRED, -1, 1 },
};
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "UTRAN-Vector", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* GERAN-Vector - 3GPP TS 29.272 #7.3.20 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
/* GERAN-Vector - 3GPP TS 29.272 #7.3.20 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Item-Number" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAND" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SRES" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Kc" }, RULE_REQUIRED, -1, 1 },
};
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "GERAN-Vector", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* Authentication-Info - 3GPP TS 29.272 #7.3.17 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
/* Authentication-Info - 3GPP TS 29.272 #7.3.17 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "E-UTRAN-Vector" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "UTRAN-Vector" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "GERAN-Vector" }, RULE_OPTIONAL, -1, 1 },
};
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Authentication-Info", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* EPS-Subscribed-QoS-Profile AVP - 3GPP TS 29.272 #7.3.37 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
/* EPS-Subscribed-QoS-Profile AVP - 3GPP TS 29.272 #7.3.37 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "QoS-Class-Identifier" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Allocation-Retention-Priority" }, RULE_REQUIRED, -1, 1 },
};
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "EPS-Subscribed-QoS-Profile", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* AMBR AVP - 3GPP TS 29.272 #7.3.41 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
/* AMBR AVP - 3GPP TS 29.272 #7.3.41 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Max-Requested-Bandwidth-UL" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Max-Requested-Bandwidth-DL" }, RULE_REQUIRED, -1, 1 },
};
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AMBR", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* Specific-APN-Info AVP - 3GPP TS 29.272 #7.3.82 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
/* Specific-APN-Info AVP - 3GPP TS 29.272 #7.3.82 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_name = "Service-Selection" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "MIP6-Agent-Info" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Visited-Network-Identifier" }, RULE_OPTIONAL, -1, 1 },
};
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Specific-APN-Info", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* APN-Configuration AVP - 3GPP TS 29.272 #7.3.35 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
/* APN-Configuration AVP - 3GPP TS 29.272 #7.3.35 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Context-Identifier" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Served-Party-IP-Address" }, RULE_OPTIONAL, -1, 2 },
{ { .avp_vendor = 10415, .avp_name = "PDN-Type" }, RULE_REQUIRED, -1, 1 },
@ -275,31 +275,31 @@ int ogs_dict_s6a_entry(char *conffile)
{ { .avp_vendor = 10415, .avp_name = "APN-OI-Replacement" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SIPTO-Permission" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "LIPA-Permission" }, RULE_OPTIONAL, -1, 1 },
};
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Configuration", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* APN-Configuration-Profile AVP - 3GPP TS 29.272 #7.3.34 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
/* APN-Configuration-Profile AVP - 3GPP TS 29.272 #7.3.34 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Context-Identifier" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "All-APN-Configurations-Included-Indicator" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "APN-Configuration" }, RULE_REQUIRED, -1, -1 },
};
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Configuration-Profile", &avp);
PARSE_loc_rules( rules, avp );
}
PARSE_loc_rules( rules, avp );
}
/* Subscription-Data AVP - 3GPP TS 29.272 #7.3.2 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
/* Subscription-Data AVP - 3GPP TS 29.272 #7.3.2 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Subscriber-Status" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "MSISDN" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "STN-SR" }, RULE_OPTIONAL, -1, 1 },
@ -326,18 +326,18 @@ int ogs_dict_s6a_entry(char *conffile)
{ { .avp_vendor = 10415, .avp_name = "VPLMN-LIPA-Allowed" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Relay-Node-Indicator" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "MDT-User-Consent" }, RULE_OPTIONAL, -1, 1 },
};
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Data", &avp);
PARSE_loc_rules( rules, avp );
}
};
PARSE_loc_rules( rules, avp );
}
};
/* Command section */
{
/* S6A-Update Location Request - 3GPP TS 29.272 #7.2.3 */
/* S6A-Update Location Request - 3GPP TS 29.272 #7.2.3 */
{
struct dict_object * cmd;
struct dict_object * cmd;
struct dict_cmd_data data = {
316, /* Code */
"Update-Location-Request", /* Name */
@ -372,9 +372,9 @@ int ogs_dict_s6a_entry(char *conffile)
PARSE_loc_rules(rules, cmd);
}
/* S6A-Update Location Answer - 3GPP TS 29.272 #7.2.4 */
/* S6A-Update Location Answer - 3GPP TS 29.272 #7.2.4 */
{
struct dict_object * cmd;
struct dict_object * cmd;
struct dict_cmd_data data = {
316, /* Code */
"Update-Location-Answer", /* Name */
@ -402,9 +402,9 @@ int ogs_dict_s6a_entry(char *conffile)
PARSE_loc_rules(rules, cmd);
}
/* S6A-Authentication-Information-Request - 3GPP TS 29.272 #7.2.4 */
/* S6A-Authentication-Information-Request - 3GPP TS 29.272 #7.2.4 */
{
struct dict_object * cmd;
struct dict_object * cmd;
struct dict_cmd_data data = {
318, /* Code */
"Authentication-Information-Request", /* Name */
@ -434,9 +434,9 @@ int ogs_dict_s6a_entry(char *conffile)
PARSE_loc_rules(rules, cmd);
}
/* S6A-Authentication-Information-Answer - 3GPP TS 29.272 #7.2.6 */
/* S6A-Authentication-Information-Answer - 3GPP TS 29.272 #7.2.6 */
{
struct dict_object * cmd;
struct dict_object * cmd;
struct dict_cmd_data data = {
318, /* Code */
"Authentication-Information-Answer", /* Name */
@ -464,17 +464,17 @@ int ogs_dict_s6a_entry(char *conffile)
PARSE_loc_rules(rules, cmd);
}
/* Purge-UE-Request (PUR) Command - 3GPP TS 29.272 #7.2.13 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
321, /* Code */
"Purge-UE-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
/* Purge-UE-Request (PUR) Command - 3GPP TS 29.272 #7.2.13 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
321, /* Code */
"Purge-UE-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
@ -491,23 +491,23 @@ int ogs_dict_s6a_entry(char *conffile)
#endif
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
};
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Purge-UE-Answer (PUA) Command - 3GPP TS 29.272 #7.2.14 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
321, /* Code */
"Purge-UE-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
/* Purge-UE-Answer (PUA) Command - 3GPP TS 29.272 #7.2.14 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
321, /* Code */
"Purge-UE-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
@ -520,23 +520,23 @@ int ogs_dict_s6a_entry(char *conffile)
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
};
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Cancel-Location-Request (CLR) Command - 3GPP TS 29.272 #7.2.7 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
317, /* Code */
"Cancel-Location-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
/* Cancel-Location-Request (CLR) Command - 3GPP TS 29.272 #7.2.7 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
317, /* Code */
"Cancel-Location-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
@ -550,23 +550,23 @@ int ogs_dict_s6a_entry(char *conffile)
{ { .avp_vendor = 10415, .avp_name = "CLR-Flags" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
};
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Cancel-Location-Answer (CLA) Command - 3GPP TS 29.272 #7.2.8 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
317, /* Code */
"Cancel-Location-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
/* Cancel-Location-Answer (CLA) Command - 3GPP TS 29.272 #7.2.8 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
317, /* Code */
"Cancel-Location-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
@ -577,23 +577,23 @@ int ogs_dict_s6a_entry(char *conffile)
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
};
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Insert-Subscriber-Data-Request (IDR) Command - 3GPP TS 29.272 #7.2.9 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
319, /* Code */
"Insert-Subscriber-Data-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
/* Insert-Subscriber-Data-Request (IDR) Command - 3GPP TS 29.272 #7.2.9 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
319, /* Code */
"Insert-Subscriber-Data-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
@ -607,23 +607,23 @@ int ogs_dict_s6a_entry(char *conffile)
{ { .avp_vendor = 10415, .avp_name = "IDR-Flags" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
};
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Insert-Subscriber-Data-Answer (IDA) Command - 3GPP TS 29.272 #7.2.10 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
319, /* Code */
"Insert-Subscriber-Data-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
/* Insert-Subscriber-Data-Answer (IDA) Command - 3GPP TS 29.272 #7.2.10 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
319, /* Code */
"Insert-Subscriber-Data-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
@ -642,16 +642,16 @@ int ogs_dict_s6a_entry(char *conffile)
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
};
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
}
LOG_D( "Extension 'Dictionary definitions for DCCA 3GPP S6A' initialized");
return 0;
return 0;
}
#if 0 /* modified by acetcom */

View File

@ -19,8 +19,8 @@
#include "ogs-diameter-s6a.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_s6a_application = NULL;
@ -166,5 +166,5 @@ int ogs_diam_s6a_init(void)
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "MSISDN", &ogs_diam_s6a_msisdn);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "A-MSISDN", &ogs_diam_s6a_a_msisdn);
return 0;
return 0;
}

View File

@ -19,8 +19,8 @@
#include "ogs-diameter-s6b.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_s6b_application = NULL;

View File

@ -19,8 +19,8 @@
#include "ogs-diameter-swx.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_swx_application = NULL;

View File

@ -321,14 +321,14 @@ int ogs_sctp_sendmsg(ogs_sock_t *sock, const void *msg, size_t len,
int ogs_sctp_recvmsg(ogs_sock_t *sock, void *msg, size_t len,
ogs_sockaddr_t *from, ogs_sctp_info_t *sinfo, int *msg_flags)
{
struct socket *socket = (struct socket *)sock;
struct socket *socket = (struct socket *)sock;
ogs_sockaddr_t addr;
ssize_t n = 0;
int flags = 0;
ssize_t n = 0;
int flags = 0;
socklen_t addrlen = sizeof(struct sockaddr_storage);
socklen_t infolen;
struct sctp_rcvinfo rcv_info;
unsigned int infotype = 0;
socklen_t infolen;
struct sctp_rcvinfo rcv_info;
unsigned int infotype = 0;
ogs_assert(socket);

View File

@ -39,42 +39,42 @@
static int utun_open(int unit, char *ifname, socklen_t maxlen)
{
struct sockaddr_ctl addr;
struct ctl_info info;
int fd = -1;
int err = 0;
struct sockaddr_ctl addr;
struct ctl_info info;
int fd = -1;
int err = 0;
ogs_assert(ifname);
ogs_assert(maxlen);
fd = socket(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL);
if (fd < 0) return fd;
fd = socket(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL);
if (fd < 0) return fd;
bzero(&info, sizeof (info));
strncpy(info.ctl_name, UTUN_CONTROL_NAME, MAX_KCTL_NAME);
bzero(&info, sizeof (info));
strncpy(info.ctl_name, UTUN_CONTROL_NAME, MAX_KCTL_NAME);
err = ioctl(fd, CTLIOCGINFO, &info);
if (err != 0) goto on_error;
err = ioctl(fd, CTLIOCGINFO, &info);
if (err != 0) goto on_error;
addr.sc_len = sizeof(addr);
addr.sc_family = AF_SYSTEM;
addr.ss_sysaddr = AF_SYS_CONTROL;
addr.sc_id = info.ctl_id;
addr.sc_unit = unit + 1;
addr.sc_len = sizeof(addr);
addr.sc_family = AF_SYSTEM;
addr.ss_sysaddr = AF_SYS_CONTROL;
addr.sc_id = info.ctl_id;
addr.sc_unit = unit + 1;
err = connect(fd, (struct sockaddr *)&addr, sizeof (addr));
if (err != 0) goto on_error;
err = connect(fd, (struct sockaddr *)&addr, sizeof (addr));
if (err != 0) goto on_error;
err = getsockopt(fd, SYSPROTO_CONTROL, UTUN_OPT_IFNAME, ifname, &maxlen);
if (err != 0) goto on_error;
err = getsockopt(fd, SYSPROTO_CONTROL, UTUN_OPT_IFNAME, ifname, &maxlen);
if (err != 0) goto on_error;
on_error:
if (err != 0) {
close(fd);
return err;
}
if (err != 0) {
close(fd);
return err;
}
return fd;
return fd;
}
#endif
@ -118,51 +118,51 @@ static int tun_set_ipv4(char *ifname,
{
int fd;
struct ifaliasreq ifa;
struct ifreq ifr;
struct sockaddr_in addr;
struct sockaddr_in mask;
struct ifaliasreq ifa;
struct ifreq ifr;
struct sockaddr_in addr;
struct sockaddr_in mask;
char buf[512];
int len;
struct rt_msghdr *rtm;
struct sockaddr_in dst, gw;
struct sockaddr_in *paddr;
struct sockaddr_in *paddr;
ogs_assert(ipaddr);
ogs_assert(ipsub);
fd = socket(ipaddr->family, SOCK_DGRAM, 0);
(void)memset(&ifa, '\0', sizeof ifa);
(void)strlcpy(ifa.ifra_name, ifname, sizeof ifa.ifra_name);
(void)memset(&ifa, '\0', sizeof ifa);
(void)strlcpy(ifa.ifra_name, ifname, sizeof ifa.ifra_name);
(void)memset(&ifr, '\0', sizeof ifr);
(void)strlcpy(ifr.ifr_name, ifname, sizeof ifr.ifr_name);
(void)memset(&ifr, '\0', sizeof ifr);
(void)strlcpy(ifr.ifr_name, ifname, sizeof ifr.ifr_name);
#if 0
/* Delete previously assigned address */
(void)ioctl(fd, SIOCDIFADDR, &ifr);
/* Delete previously assigned address */
(void)ioctl(fd, SIOCDIFADDR, &ifr);
#endif
(void)memset(&addr, '\0', sizeof(addr));
addr.sin_family = ipaddr->family;
addr.sin_addr.s_addr = ipaddr->sub[0];
addr.sin_len = sizeof(addr);
(void)memcpy(&ifa.ifra_addr, &addr, sizeof(addr));
(void)memcpy(&ifa.ifra_broadaddr, &addr, sizeof(addr));
(void)memset(&addr, '\0', sizeof(addr));
addr.sin_family = ipaddr->family;
addr.sin_addr.s_addr = ipaddr->sub[0];
addr.sin_len = sizeof(addr);
(void)memcpy(&ifa.ifra_addr, &addr, sizeof(addr));
(void)memcpy(&ifa.ifra_broadaddr, &addr, sizeof(addr));
(void)memset(&mask, '\0', sizeof(mask));
mask.sin_family = ipaddr->family;
mask.sin_addr.s_addr = ipaddr->mask[0];
mask.sin_len = sizeof(mask);
(void)memcpy(&ifa.ifra_mask, &mask, sizeof(ifa.ifra_mask));
(void)memset(&mask, '\0', sizeof(mask));
mask.sin_family = ipaddr->family;
mask.sin_addr.s_addr = ipaddr->mask[0];
mask.sin_len = sizeof(mask);
(void)memcpy(&ifa.ifra_mask, &mask, sizeof(ifa.ifra_mask));
if (ioctl(fd, SIOCAIFADDR, &ifa) == -1) {
if (ioctl(fd, SIOCAIFADDR, &ifa) == -1) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
"Can't IP address : dev[%s]", ifname);
return OGS_ERROR;
}
return OGS_ERROR;
}
close(fd); /* SOCK_DGRAM */
@ -183,27 +183,27 @@ static int tun_set_ipv4(char *ifname,
rtm->rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK;
paddr = (struct sockaddr_in *)(rtm + 1);
(void)memset(&dst, '\0', sizeof(dst));
dst.sin_family = ipaddr->family;
dst.sin_addr.s_addr = ipsub->sub[0];
dst.sin_len = sizeof(dst);
(void)memcpy(paddr, &dst, sizeof(dst));
(void)memset(&dst, '\0', sizeof(dst));
dst.sin_family = ipaddr->family;
dst.sin_addr.s_addr = ipsub->sub[0];
dst.sin_len = sizeof(dst);
(void)memcpy(paddr, &dst, sizeof(dst));
paddr = (struct sockaddr_in *)((char *)paddr +
TUN_ALIGN(sizeof(*paddr), sizeof(uintptr_t)));
(void)memset(&gw, '\0', sizeof(gw));
gw.sin_family = ipaddr->family;
gw.sin_addr.s_addr = ipaddr->sub[0];
gw.sin_len = sizeof(gw);
(void)memcpy(paddr, &gw, sizeof(gw));
(void)memset(&gw, '\0', sizeof(gw));
gw.sin_family = ipaddr->family;
gw.sin_addr.s_addr = ipaddr->sub[0];
gw.sin_len = sizeof(gw);
(void)memcpy(paddr, &gw, sizeof(gw));
paddr = (struct sockaddr_in *)((char *)paddr +
TUN_ALIGN(sizeof(*paddr), sizeof(uintptr_t)));
(void)memset(&mask, '\0', sizeof(mask));
mask.sin_family = ipaddr->family;
mask.sin_addr.s_addr = ipsub->mask[0];
mask.sin_len = sizeof(mask);
(void)memcpy(paddr, &mask, sizeof(mask));
(void)memset(&mask, '\0', sizeof(mask));
mask.sin_family = ipaddr->family;
mask.sin_addr.s_addr = ipsub->mask[0];
mask.sin_len = sizeof(mask);
(void)memcpy(paddr, &mask, sizeof(mask));
paddr = (struct sockaddr_in *)((char *)paddr +
TUN_ALIGN(sizeof(*paddr), sizeof(uintptr_t)));
@ -217,7 +217,7 @@ static int tun_set_ipv4(char *ifname,
close(fd); /* PF_ROUTE, SOCK_RAW */
return OGS_OK;
return OGS_OK;
}
static int tun_set_ipv6(char *ifname,
@ -263,54 +263,54 @@ static int tun_set_ipv6(char *ifname,
#else /* IPv6 Setting API is not working in UTUN */
int fd;
struct in6_aliasreq ifa;
struct in6_ifreq ifr;
struct sockaddr_in6 addr;
struct sockaddr_in6 mask;
struct in6_aliasreq ifa;
struct in6_ifreq ifr;
struct sockaddr_in6 addr;
struct sockaddr_in6 mask;
char buf[512];
int len;
struct rt_msghdr *rtm;
struct sockaddr_in6 dst, gw;
struct sockaddr_in6 *paddr;
struct sockaddr_in6 *paddr;
ogs_assert(ipaddr);
ogs_assert(ipsub);
fd = socket(ipaddr->family, SOCK_DGRAM, 0);
(void)memset(&ifa, '\0', sizeof ifa);
(void)strlcpy(ifa.ifra_name, ifname, sizeof ifa.ifra_name);
(void)memset(&ifa, '\0', sizeof ifa);
(void)strlcpy(ifa.ifra_name, ifname, sizeof ifa.ifra_name);
(void)memset(&ifr, '\0', sizeof ifr);
(void)strlcpy(ifr.ifr_name, ifname, sizeof ifr.ifr_name);
(void)memset(&ifr, '\0', sizeof ifr);
(void)strlcpy(ifr.ifr_name, ifname, sizeof ifr.ifr_name);
#if 0
/* Delete previously assigned address */
(void)ioctl(fd, SIOCDIFADDR, &ifr);
/* Delete previously assigned address */
(void)ioctl(fd, SIOCDIFADDR, &ifr);
#endif
(void)memset(&addr, '\0', sizeof(addr));
addr.sin6_family = ipaddr->family;
(void)memset(&addr, '\0', sizeof(addr));
addr.sin6_family = ipaddr->family;
memcpy(addr.sin6_addr.s6_addr, ipaddr->sub, sizeof ipaddr->sub);
addr.sin6_len = sizeof(addr);
(void)memcpy(&ifa.ifra_addr, &addr, sizeof(addr));
(void)memcpy(&ifa.ifra_dstaddr, &addr, sizeof(addr));
addr.sin6_len = sizeof(addr);
(void)memcpy(&ifa.ifra_addr, &addr, sizeof(addr));
(void)memcpy(&ifa.ifra_dstaddr, &addr, sizeof(addr));
(void)memset(&mask, '\0', sizeof(mask));
mask.sin6_family = ipaddr->family;
(void)memset(&mask, '\0', sizeof(mask));
mask.sin6_family = ipaddr->family;
memcpy(mask.sin6_addr.s6_addr, ipaddr->mask, sizeof ipaddr->mask);
mask.sin6_len = sizeof(mask);
(void)memcpy(&ifa.ifra_prefixmask, &mask, sizeof(ifa.ifra_prefixmask));
mask.sin6_len = sizeof(mask);
(void)memcpy(&ifa.ifra_prefixmask, &mask, sizeof(ifa.ifra_prefixmask));
ifa.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
ifa.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
if (ioctl(fd, SIOCAIFADDR_IN6, &ifa) == -1) {
if (ioctl(fd, SIOCAIFADDR_IN6, &ifa) == -1) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
"Can't IP address : dev[%s]", ifname);
return OGS_ERROR;
}
return OGS_ERROR;
}
close(fd); /* SOCK_DGRAM */
@ -331,11 +331,11 @@ static int tun_set_ipv6(char *ifname,
rtm->rtm_addrs = RTA_DST;
paddr = (struct sockaddr_in6 *)(rtm + 1);
(void)memset(&dst, '\0', sizeof(dst));
dst.sin6_family = ipaddr->family;
(void)memset(&dst, '\0', sizeof(dst));
dst.sin6_family = ipaddr->family;
memcpy(dst.sin6_addr.s6_addr, ipaddr->sub, sizeof ipsub->sub);
dst.sin6_len = sizeof(dst);
(void)memcpy(paddr, &dst, sizeof(dst));
dst.sin6_len = sizeof(dst);
(void)memcpy(paddr, &dst, sizeof(dst));
paddr = (struct sockaddr_in6 *)((char *)paddr +
TUN_ALIGN(sizeof(*paddr), sizeof(uintptr_t)));
@ -359,27 +359,27 @@ static int tun_set_ipv6(char *ifname,
rtm->rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK;
paddr = (struct sockaddr_in6 *)(rtm + 1);
(void)memset(&dst, '\0', sizeof(dst));
dst.sin6_family = ipaddr->family;
(void)memset(&dst, '\0', sizeof(dst));
dst.sin6_family = ipaddr->family;
memcpy(dst.sin6_addr.s6_addr, ipsub->sub, sizeof ipsub->sub);
dst.sin6_len = sizeof(dst);
(void)memcpy(paddr, &dst, sizeof(dst));
dst.sin6_len = sizeof(dst);
(void)memcpy(paddr, &dst, sizeof(dst));
paddr = (struct sockaddr_in6 *)((char *)paddr +
TUN_ALIGN(sizeof(*paddr), sizeof(uintptr_t)));
(void)memset(&gw, '\0', sizeof(gw));
gw.sin6_family = ipaddr->family;
(void)memset(&gw, '\0', sizeof(gw));
gw.sin6_family = ipaddr->family;
memcpy(gw.sin6_addr.s6_addr, ipaddr->sub, sizeof ipaddr->sub);
gw.sin6_len = sizeof(gw);
(void)memcpy(paddr, &gw, sizeof(gw));
gw.sin6_len = sizeof(gw);
(void)memcpy(paddr, &gw, sizeof(gw));
paddr = (struct sockaddr_in6 *)((char *)paddr +
TUN_ALIGN(sizeof(*paddr), sizeof(uintptr_t)));
(void)memset(&mask, '\0', sizeof(mask));
mask.sin6_family = ipaddr->family;
(void)memset(&mask, '\0', sizeof(mask));
mask.sin6_family = ipaddr->family;
memcpy(mask.sin6_addr.s6_addr, ipsub->mask, sizeof ipsub->mask);
mask.sin6_len = sizeof(mask);
(void)memcpy(paddr, &mask, sizeof(mask));
mask.sin6_len = sizeof(mask);
(void)memcpy(paddr, &mask, sizeof(mask));
paddr = (struct sockaddr_in6 *)((char *)paddr +
TUN_ALIGN(sizeof(*paddr), sizeof(uintptr_t)));
@ -395,7 +395,7 @@ static int tun_set_ipv6(char *ifname,
#endif
return OGS_OK;
return OGS_OK;
}
int ogs_tun_set_ip(char *ifname, ogs_ipsubnet_t *gw, ogs_ipsubnet_t *sub)

View File

@ -6,10 +6,10 @@ if [ "$SYSTEM" = "Linux" ]; then
if ! grep "ogstun" /proc/net/dev > /dev/null; then
ip tuntap add name ogstun mode tun
fi
if test "x`sysctl -n net.ipv6.conf.ogstun.disable_ipv6`" = x1; then
echo "net.ipv6.conf.ogstun.disable_ipv6=0" > /etc/sysctl.d/30-open5gs.conf
sysctl -p /etc/sysctl.d/30-open5gs.conf
fi
if test "x`sysctl -n net.ipv6.conf.ogstun.disable_ipv6`" = x1; then
echo "net.ipv6.conf.ogstun.disable_ipv6=0" > /etc/sysctl.d/30-open5gs.conf
sysctl -p /etc/sysctl.d/30-open5gs.conf
fi
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
ip addr add 10.45.0.1/16 dev ogstun
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null

View File

@ -203,7 +203,7 @@ int ngap_send_to_nas(ran_ue_t *ran_ue,
if (nas_5gs_security_decode(ran_ue->amf_ue,
security_header_type, nasbuf) != OGS_OK) {
ogs_error("nas_eps_security_decode failed()");
return OGS_ERROR;
return OGS_ERROR;
}
}

View File

@ -78,12 +78,12 @@ void ngap_recv_upcall(short when, ogs_socket_t fd, void *data)
#if HAVE_USRSCTP
static void usrsctp_recv_handler(struct socket *socket, void *data, int flags)
{
int events;
int events;
while ((events = usrsctp_get_events(socket)) &&
while ((events = usrsctp_get_events(socket)) &&
(events & SCTP_EVENT_READ)) {
ngap_recv_handler((ogs_sock_t *)socket);
}
}
}
#else
static void lksctp_accept_handler(short when, ogs_socket_t fd, void *data)

View File

@ -37,10 +37,10 @@ static struct disp_hdl *hdl_cx_lir = NULL;
static int hss_ogs_diam_cx_fb_cb(struct msg **msg, struct avp *avp,
struct session *session, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
}
/* Callback for incoming User-Authorization-Request messages */
@ -50,7 +50,7 @@ static int hss_ogs_diam_cx_uar_cb( struct msg **msg, struct avp *avp,
int rv, ret;
uint32_t result_code = 0;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp_hdr *hdr;
union avp_value val;
@ -63,14 +63,14 @@ static int hss_ogs_diam_cx_uar_cb( struct msg **msg, struct avp *avp,
char imsi_or_msisdn_bcd[OGS_MAX_IMSI_BCD_LEN+1];
ogs_msisdn_data_t msisdn_data;
ogs_assert(msg);
ogs_debug("User-Authorization-Request");
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -134,7 +134,7 @@ static int hss_ogs_diam_cx_uar_cb( struct msg **msg, struct avp *avp,
else
result_code = OGS_DIAM_CX_SUBSEQUENT_REGISTRATION;
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
ret = ogs_diam_message_experimental_rescode_set(ans, result_code);
ogs_assert(ret == 0);
@ -159,22 +159,22 @@ static int hss_ogs_diam_cx_uar_cb( struct msg **msg, struct avp *avp,
ogs_assert(ret == 0);
}
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("User-Authorization-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_free(user_name);
ogs_free(public_identity);
ogs_free(visited_network_identifier);
return 0;
return 0;
out:
/* Set Vendor-Specific-Application-Id AVP */
@ -182,7 +182,7 @@ out:
ans, OGS_DIAM_CX_APPLICATION_ID);
ogs_assert(ret == 0);
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
ret = ogs_diam_message_experimental_rescode_set(ans, result_code);
ogs_assert(ret == 0);
@ -195,7 +195,7 @@ out:
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_free(user_name);
@ -212,7 +212,7 @@ static int hss_ogs_diam_cx_mar_cb( struct msg **msg, struct avp *avp,
int rv, ret;
uint32_t result_code = 0;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp *sip_auth_data_item_avp = NULL;
struct avp *authentication_scheme_avp = NULL;
@ -252,9 +252,9 @@ static int hss_ogs_diam_cx_mar_cb( struct msg **msg, struct avp *avp,
ogs_debug("Multimedia-Auth-Request");
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -449,8 +449,8 @@ static int hss_ogs_diam_cx_mar_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Set the User-Name AVP */
@ -548,16 +548,16 @@ static int hss_ogs_diam_cx_mar_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("Multimedia-Auth-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
if (authentication_scheme)
ogs_free(authentication_scheme);
@ -566,7 +566,7 @@ static int hss_ogs_diam_cx_mar_cb( struct msg **msg, struct avp *avp,
ogs_free(public_identity);
ogs_free(server_name);
return 0;
return 0;
out:
/* Set Vendor-Specific-Application-Id AVP */
@ -574,7 +574,7 @@ out:
ans, OGS_DIAM_CX_APPLICATION_ID);
ogs_assert(ret == 0);
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
ret = ogs_diam_message_experimental_rescode_set(ans, result_code);
ogs_assert(ret == 0);
@ -587,7 +587,7 @@ out:
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
if (authentication_scheme)
@ -607,7 +607,7 @@ static int hss_ogs_diam_cx_sar_cb( struct msg **msg, struct avp *avp,
int rv, ret;
uint32_t result_code = 0;
struct msg *ans, *qry;
struct msg *ans, *qry;
bool matched = false;
struct avp *user_name_avp = NULL;
@ -629,9 +629,9 @@ static int hss_ogs_diam_cx_sar_cb( struct msg **msg, struct avp *avp,
ogs_debug("Server-Assignment-Request");
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -733,8 +733,8 @@ static int hss_ogs_diam_cx_sar_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
if (user_name_avp) {
@ -808,16 +808,16 @@ static int hss_ogs_diam_cx_sar_cb( struct msg **msg, struct avp *avp,
}
}
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("Server-Assignment-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
if (user_data)
ogs_free(user_data);
@ -825,7 +825,7 @@ static int hss_ogs_diam_cx_sar_cb( struct msg **msg, struct avp *avp,
ogs_free(public_identity);
ogs_free(server_name);
return 0;
return 0;
out:
/* Set Vendor-Specific-Application-Id AVP */
@ -833,7 +833,7 @@ out:
ans, OGS_DIAM_CX_APPLICATION_ID);
ogs_assert(ret == 0);
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
ret = ogs_diam_message_experimental_rescode_set(ans, result_code);
ogs_assert(ret == 0);
@ -846,7 +846,7 @@ out:
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
if (user_data)
@ -865,7 +865,7 @@ static int hss_ogs_diam_cx_lir_cb( struct msg **msg, struct avp *avp,
int ret;
uint32_t result_code = 0;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp_hdr *hdr;
union avp_value val;
@ -877,9 +877,9 @@ static int hss_ogs_diam_cx_lir_cb( struct msg **msg, struct avp *avp,
ogs_debug("Location-Info-Request");
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -915,8 +915,8 @@ static int hss_ogs_diam_cx_lir_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Set Server-Name AVPs */
@ -929,20 +929,20 @@ static int hss_ogs_diam_cx_lir_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("Location-Info-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_free(public_identity);
return 0;
return 0;
out:
/* Set Vendor-Specific-Application-Id AVP */
@ -950,7 +950,7 @@ out:
ans, OGS_DIAM_CX_APPLICATION_ID);
ogs_assert(ret == 0);
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
ret = ogs_diam_message_experimental_rescode_set(ans, result_code);
ogs_assert(ret == 0);
@ -963,7 +963,7 @@ out:
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_free(public_identity);
@ -974,61 +974,61 @@ out:
int hss_cx_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
/* Install objects definitions for this application */
ret = ogs_diam_cx_init();
/* Install objects definitions for this application */
ret = ogs_diam_cx_init();
ogs_assert(ret == 0);
memset(&data, 0, sizeof(data));
data.app = ogs_diam_cx_application;
/* Fallback CB if command != unexpected message received */
ret = fd_disp_register(hss_ogs_diam_cx_fb_cb, DISP_HOW_APPID,
memset(&data, 0, sizeof(data));
data.app = ogs_diam_cx_application;
/* Fallback CB if command != unexpected message received */
ret = fd_disp_register(hss_ogs_diam_cx_fb_cb, DISP_HOW_APPID,
&data, NULL, &hdl_cx_fb);
ogs_assert(ret == 0);
/* Specific handler for User-Authorization-Request */
data.command = ogs_diam_cx_cmd_uar;
ret = fd_disp_register(hss_ogs_diam_cx_uar_cb, DISP_HOW_CC, &data, NULL,
/* Specific handler for User-Authorization-Request */
data.command = ogs_diam_cx_cmd_uar;
ret = fd_disp_register(hss_ogs_diam_cx_uar_cb, DISP_HOW_CC, &data, NULL,
&hdl_cx_uar);
ogs_assert(ret == 0);
/* Specific handler for Multimedia-Auth-Request */
data.command = ogs_diam_cx_cmd_mar;
ret = fd_disp_register(hss_ogs_diam_cx_mar_cb, DISP_HOW_CC, &data, NULL,
/* Specific handler for Multimedia-Auth-Request */
data.command = ogs_diam_cx_cmd_mar;
ret = fd_disp_register(hss_ogs_diam_cx_mar_cb, DISP_HOW_CC, &data, NULL,
&hdl_cx_mar);
ogs_assert(ret == 0);
/* Specific handler for Server-Assignment-Request */
data.command = ogs_diam_cx_cmd_sar;
ret = fd_disp_register(hss_ogs_diam_cx_sar_cb, DISP_HOW_CC, &data, NULL,
/* Specific handler for Server-Assignment-Request */
data.command = ogs_diam_cx_cmd_sar;
ret = fd_disp_register(hss_ogs_diam_cx_sar_cb, DISP_HOW_CC, &data, NULL,
&hdl_cx_sar);
ogs_assert(ret == 0);
/* Specific handler for Location-Info-Request */
data.command = ogs_diam_cx_cmd_lir;
ret = fd_disp_register(hss_ogs_diam_cx_lir_cb, DISP_HOW_CC, &data, NULL,
/* Specific handler for Location-Info-Request */
data.command = ogs_diam_cx_cmd_lir;
ret = fd_disp_register(hss_ogs_diam_cx_lir_cb, DISP_HOW_CC, &data, NULL,
&hdl_cx_lir);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_cx_application, ogs_diam_vendor, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_cx_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return OGS_OK;
return OGS_OK;
}
void hss_cx_final(void)
{
if (hdl_cx_fb)
(void) fd_disp_unregister(&hdl_cx_fb, NULL);
if (hdl_cx_uar)
(void) fd_disp_unregister(&hdl_cx_uar, NULL);
if (hdl_cx_mar)
(void) fd_disp_unregister(&hdl_cx_mar, NULL);
if (hdl_cx_sar)
(void) fd_disp_unregister(&hdl_cx_sar, NULL);
if (hdl_cx_lir)
(void) fd_disp_unregister(&hdl_cx_lir, NULL);
if (hdl_cx_fb)
(void) fd_disp_unregister(&hdl_cx_fb, NULL);
if (hdl_cx_uar)
(void) fd_disp_unregister(&hdl_cx_uar, NULL);
if (hdl_cx_mar)
(void) fd_disp_unregister(&hdl_cx_mar, NULL);
if (hdl_cx_sar)
(void) fd_disp_unregister(&hdl_cx_sar, NULL);
if (hdl_cx_lir)
(void) fd_disp_unregister(&hdl_cx_lir, NULL);
}

View File

@ -40,7 +40,7 @@ int hss_fd_init(void)
rv = ogs_diam_start();
ogs_assert(rv == 0);
return OGS_OK;
return OGS_OK;
}
void hss_fd_final(void)

View File

@ -43,7 +43,7 @@ int hss_initialize(void)
initialized = 1;
return OGS_OK;
return OGS_OK;
}
void hss_terminate(void)
@ -54,6 +54,6 @@ void hss_terminate(void)
ogs_dbi_final();
hss_context_final();
return;
return;
}

View File

@ -33,10 +33,10 @@ static struct disp_hdl *hdl_s6a_ulr = NULL;
static int hss_ogs_diam_s6a_fb_cb(struct msg **msg, struct avp *avp,
struct session *session, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
}
/* Callback for incoming Authentication-Information-Request messages */
@ -75,9 +75,9 @@ static int hss_ogs_diam_s6a_air_cb( struct msg **msg, struct avp *avp,
ogs_debug("Authentication-Information-Request");
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -211,8 +211,8 @@ static int hss_ogs_diam_s6a_air_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Set the Auth-Session-State AVP */
@ -229,18 +229,18 @@ static int hss_ogs_diam_s6a_air_cb( struct msg **msg, struct avp *avp,
ans, OGS_DIAM_S6A_APPLICATION_ID);
ogs_assert(ret == 0);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("Authentication-Information-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
return 0;
return 0;
out:
ret = ogs_diam_message_experimental_rescode_set(ans, result_code);
@ -260,7 +260,7 @@ out:
ans, OGS_DIAM_S6A_APPLICATION_ID);
ogs_assert(ret == 0);
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
return 0;
@ -866,45 +866,45 @@ out:
int hss_s6a_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
/* Install objects definitions for this application */
ret = ogs_diam_s6a_init();
/* Install objects definitions for this application */
ret = ogs_diam_s6a_init();
ogs_assert(ret == 0);
memset(&data, 0, sizeof(data));
data.app = ogs_diam_s6a_application;
/* Fallback CB if command != unexpected message received */
ret = fd_disp_register(hss_ogs_diam_s6a_fb_cb, DISP_HOW_APPID, &data, NULL,
memset(&data, 0, sizeof(data));
data.app = ogs_diam_s6a_application;
/* Fallback CB if command != unexpected message received */
ret = fd_disp_register(hss_ogs_diam_s6a_fb_cb, DISP_HOW_APPID, &data, NULL,
&hdl_s6a_fb);
ogs_assert(ret == 0);
/* Specific handler for Authentication-Information-Request */
data.command = ogs_diam_s6a_cmd_air;
ret = fd_disp_register(hss_ogs_diam_s6a_air_cb, DISP_HOW_CC, &data, NULL,
/* Specific handler for Authentication-Information-Request */
data.command = ogs_diam_s6a_cmd_air;
ret = fd_disp_register(hss_ogs_diam_s6a_air_cb, DISP_HOW_CC, &data, NULL,
&hdl_s6a_air);
ogs_assert(ret == 0);
/* Specific handler for Location-Update-Request */
data.command = ogs_diam_s6a_cmd_ulr;
ret = fd_disp_register(hss_ogs_diam_s6a_ulr_cb, DISP_HOW_CC, &data, NULL,
/* Specific handler for Location-Update-Request */
data.command = ogs_diam_s6a_cmd_ulr;
ret = fd_disp_register(hss_ogs_diam_s6a_ulr_cb, DISP_HOW_CC, &data, NULL,
&hdl_s6a_ulr);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_s6a_application, ogs_diam_vendor, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_s6a_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return OGS_OK;
return OGS_OK;
}
void hss_s6a_final(void)
{
if (hdl_s6a_fb)
(void) fd_disp_unregister(&hdl_s6a_fb, NULL);
if (hdl_s6a_air)
(void) fd_disp_unregister(&hdl_s6a_air, NULL);
if (hdl_s6a_ulr)
(void) fd_disp_unregister(&hdl_s6a_ulr, NULL);
if (hdl_s6a_fb)
(void) fd_disp_unregister(&hdl_s6a_fb, NULL);
if (hdl_s6a_air)
(void) fd_disp_unregister(&hdl_s6a_air, NULL);
if (hdl_s6a_ulr)
(void) fd_disp_unregister(&hdl_s6a_ulr, NULL);
}

View File

@ -33,10 +33,10 @@ static struct disp_hdl *hdl_swx_sar = NULL;
static int hss_ogs_diam_swx_fb_cb(struct msg **msg, struct avp *avp,
struct session *session, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
}
/* Callback for incoming Multimedia-Auth-Request messages */
@ -46,7 +46,7 @@ static int hss_ogs_diam_swx_mar_cb( struct msg **msg, struct avp *avp,
int rv, ret;
uint32_t result_code = 0;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp *sip_auth_data_item_avp = NULL;
struct avp *authentication_scheme_avp = NULL;
@ -82,9 +82,9 @@ static int hss_ogs_diam_swx_mar_cb( struct msg **msg, struct avp *avp,
ogs_debug("Multimedia-Auth-Request");
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -238,8 +238,8 @@ static int hss_ogs_diam_swx_mar_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Set the User-Name AVP */
@ -327,23 +327,23 @@ static int hss_ogs_diam_swx_mar_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("Multimedia-Auth-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
if (authentication_scheme)
ogs_free(authentication_scheme);
ogs_free(user_name);
return 0;
return 0;
out:
/* Set Vendor-Specific-Application-Id AVP */
@ -351,7 +351,7 @@ out:
ans, OGS_DIAM_SWX_APPLICATION_ID);
ogs_assert(ret == 0);
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
ret = ogs_diam_message_experimental_rescode_set(ans, result_code);
ogs_assert(ret == 0);
@ -364,7 +364,7 @@ out:
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
if (authentication_scheme)
@ -382,7 +382,7 @@ static int hss_ogs_diam_swx_sar_cb( struct msg **msg, struct avp *avp,
int rv, ret;
uint32_t result_code = 0;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp_hdr *hdr;
union avp_value val;
@ -402,9 +402,9 @@ static int hss_ogs_diam_swx_sar_cb( struct msg **msg, struct avp *avp,
memset(&subscription_data, 0, sizeof(ogs_subscription_data_t));
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -826,8 +826,8 @@ static int hss_ogs_diam_swx_sar_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, and Result-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Set the User-Name AVP */
@ -840,21 +840,21 @@ static int hss_ogs_diam_swx_sar_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("Server-Assignment-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_subscription_data_free(&subscription_data);
ogs_free(user_name);
return 0;
return 0;
out:
/* Set Vendor-Specific-Application-Id AVP */
@ -862,7 +862,7 @@ out:
ans, OGS_DIAM_SWX_APPLICATION_ID);
ogs_assert(ret == 0);
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
/* Set the Experimental-Result, Origin-Host and Origin-Realm AVPs */
ret = ogs_diam_message_experimental_rescode_set(ans, result_code);
ogs_assert(ret == 0);
@ -875,7 +875,7 @@ out:
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_subscription_data_free(&subscription_data);
@ -887,45 +887,45 @@ out:
int hss_swx_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
/* Install objects definitions for this application */
ret = ogs_diam_swx_init();
/* Install objects definitions for this application */
ret = ogs_diam_swx_init();
ogs_assert(ret == 0);
memset(&data, 0, sizeof(data));
data.app = ogs_diam_swx_application;
/* Fallback CB if command != unexpected message received */
ret = fd_disp_register(hss_ogs_diam_swx_fb_cb, DISP_HOW_APPID,
memset(&data, 0, sizeof(data));
data.app = ogs_diam_swx_application;
/* Fallback CB if command != unexpected message received */
ret = fd_disp_register(hss_ogs_diam_swx_fb_cb, DISP_HOW_APPID,
&data, NULL, &hdl_swx_fb);
ogs_assert(ret == 0);
/* Specific handler for Multimedia-Auth-Request */
data.command = ogs_diam_cx_cmd_mar;
ret = fd_disp_register(hss_ogs_diam_swx_mar_cb, DISP_HOW_CC, &data, NULL,
/* Specific handler for Multimedia-Auth-Request */
data.command = ogs_diam_cx_cmd_mar;
ret = fd_disp_register(hss_ogs_diam_swx_mar_cb, DISP_HOW_CC, &data, NULL,
&hdl_swx_mar);
ogs_assert(ret == 0);
/* Specific handler for Server-Assignment-Request */
data.command = ogs_diam_cx_cmd_sar;
ret = fd_disp_register(hss_ogs_diam_swx_sar_cb, DISP_HOW_CC, &data, NULL,
/* Specific handler for Server-Assignment-Request */
data.command = ogs_diam_cx_cmd_sar;
ret = fd_disp_register(hss_ogs_diam_swx_sar_cb, DISP_HOW_CC, &data, NULL,
&hdl_swx_sar);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_swx_application, ogs_diam_vendor, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_swx_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return OGS_OK;
return OGS_OK;
}
void hss_swx_final(void)
{
if (hdl_swx_fb)
(void) fd_disp_unregister(&hdl_swx_fb, NULL);
if (hdl_swx_mar)
(void) fd_disp_unregister(&hdl_swx_mar, NULL);
if (hdl_swx_sar)
(void) fd_disp_unregister(&hdl_swx_sar, NULL);
if (hdl_swx_fb)
(void) fd_disp_unregister(&hdl_swx_fb, NULL);
if (hdl_swx_mar)
(void) fd_disp_unregister(&hdl_swx_mar, NULL);
if (hdl_swx_sar)
(void) fd_disp_unregister(&hdl_swx_sar, NULL);
}

View File

@ -48,7 +48,7 @@ ogs_pkbuf_t *mme_s11_build_create_session_request(
struct timeval now;
struct tm time_exp;
char apn[OGS_MAX_APN_LEN+1];
ogs_gtp2_indication_t indication;
ogs_assert(sess);
@ -195,14 +195,14 @@ ogs_pkbuf_t *mme_s11_build_create_session_request(
* we need to change position of addresses in struct. */
if (req->pdn_type.u8 == OGS_PDU_SESSION_TYPE_IPV4 &&
session->session_type == OGS_PDU_SESSION_TYPE_IPV4V6) {
uint32_t addr = session->paa.both.addr;
session->paa.addr = addr;
uint32_t addr = session->paa.both.addr;
session->paa.addr = addr;
}
if (req->pdn_type.u8 == OGS_PDU_SESSION_TYPE_IPV6 &&
session->session_type == OGS_PDU_SESSION_TYPE_IPV4V6) {
uint8_t addr[16];
memcpy(&addr, session->paa.both.addr6, OGS_IPV6_LEN);
memcpy(session->paa.addr6, &addr, OGS_IPV6_LEN);
uint8_t addr[16];
memcpy(&addr, session->paa.both.addr6, OGS_IPV6_LEN);
memcpy(session->paa.addr6, &addr, OGS_IPV6_LEN);
}
memset(&indication, 0, sizeof(ogs_gtp2_indication_t));
@ -214,13 +214,13 @@ ogs_pkbuf_t *mme_s11_build_create_session_request(
indication.enb_change_reporting_support_indication = 1;
if (req->pdn_type.u8 == OGS_PDU_SESSION_TYPE_IPV4V6)
indication.dual_address_bearer_flag = 1;
indication.dual_address_bearer_flag = 1;
if (sess->request_type.value == OGS_NAS_EPS_REQUEST_TYPE_HANDOVER)
indication.handover_indication = 1;
indication.handover_indication = 1;
if (create_action == OGS_GTP_CREATE_IN_PATH_SWITCH_REQUEST)
indication.operation_indication = 1;
indication.operation_indication = 1;
session->paa.session_type = req->pdn_type.u8;
req->pdn_address_allocation.data = &session->paa;

View File

@ -211,7 +211,7 @@ int s1ap_send_to_nas(enb_ue_t *enb_ue,
if (nas_eps_security_decode(enb_ue->mme_ue,
security_header_type, nasbuf) != OGS_OK) {
ogs_error("nas_eps_security_decode failed()");
return OGS_ERROR;
return OGS_ERROR;
}
}

View File

@ -79,12 +79,12 @@ void s1ap_recv_upcall(short when, ogs_socket_t fd, void *data)
#if HAVE_USRSCTP
static void usrsctp_recv_handler(struct socket *socket, void *data, int flags)
{
int events;
int events;
while ((events = usrsctp_get_events(socket)) &&
while ((events = usrsctp_get_events(socket)) &&
(events & SCTP_EVENT_READ)) {
s1ap_recv_handler((ogs_sock_t *)socket);
}
}
}
#else
static void lksctp_accept_handler(short when, ogs_socket_t fd, void *data)

View File

@ -62,9 +62,9 @@ ogs_sock_t *sgsap_client(mme_vlr_t *vlr)
#if HAVE_USRSCTP
static void usrsctp_recv_handler(struct socket *socket, void *data, int flags)
{
int events;
int events;
while ((events = usrsctp_get_events(socket)) &&
while ((events = usrsctp_get_events(socket)) &&
(events & SCTP_EVENT_READ)) {
recv_handler((ogs_sock_t *)socket);
}

View File

@ -36,7 +36,7 @@ int pcrf_fd_init(void)
rv = ogs_diam_start();
ogs_assert(rv == 0);
return OGS_OK;
return OGS_OK;
}
void pcrf_fd_final(void)

View File

@ -188,10 +188,10 @@ static void state_cleanup(struct sess_state *sess_data, os0_t sid, void *opaque)
static int pcrf_gx_fb_cb(struct msg **msg, struct avp *avp,
struct session *sess, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
}
static int pcrf_gx_ccr_cb( struct msg **msg, struct avp *avp,
@ -200,7 +200,7 @@ static int pcrf_gx_ccr_cb( struct msg **msg, struct avp *avp,
int rv;
int ret = 0, i;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp *avpch1, *avpch2;
struct avp_hdr *hdr;
union avp_value val;
@ -211,7 +211,7 @@ static int pcrf_gx_ccr_cb( struct msg **msg, struct avp *avp,
uint32_t cc_request_type = OGS_DIAM_GX_CC_REQUEST_TYPE_INITIAL_REQUEST;
uint32_t cc_request_number = 0;
uint32_t result_code = OGS_DIAM_MISSING_AVP;
ogs_debug("[Credit-Control-Request]");
ogs_assert(msg);
@ -219,9 +219,9 @@ static int pcrf_gx_ccr_cb( struct msg **msg, struct avp *avp,
/* Initialize Message */
memset(&gx_message, 0, sizeof(ogs_diam_gx_message_t));
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -578,8 +578,8 @@ static int pcrf_gx_ccr_cb( struct msg **msg, struct avp *avp,
}
}
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
if (cc_request_type != OGS_DIAM_GX_CC_REQUEST_TYPE_TERMINATION_REQUEST) {
@ -591,23 +591,23 @@ static int pcrf_gx_ccr_cb( struct msg **msg, struct avp *avp,
state_cleanup(sess_data, NULL, NULL);
}
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("[Credit-Control-Answer]");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) ==0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) ==0);
ogs_session_data_free(&gx_message.session_data);
return 0;
out:
/* Set the Result-Code */
/* Set the Result-Code */
if (result_code == OGS_DIAM_AVP_UNSUPPORTED) {
ret = fd_msg_rescode_set(ans,
(char *)"DIAMETER_AVP_UNSUPPORTED", NULL, NULL, 1);
@ -636,7 +636,7 @@ out:
}
}
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_session_data_free(&gx_message.session_data);
@ -1144,50 +1144,50 @@ static void pcrf_gx_raa_cb(void *data, struct msg **msg)
int pcrf_gx_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
ogs_thread_mutex_init(&sess_state_mutex);
ogs_pool_init(&sess_state_pool, ogs_app()->pool.sess);
ogs_pool_init(&rx_sess_state_pool, ogs_app()->pool.sess);
/* Install objects definitions for this application */
ret = ogs_diam_gx_init();
/* Install objects definitions for this application */
ret = ogs_diam_gx_init();
ogs_assert(ret == 0);
/* Create handler for sessions */
ret = fd_sess_handler_create(&pcrf_gx_reg, state_cleanup, NULL, NULL);
ret = fd_sess_handler_create(&pcrf_gx_reg, state_cleanup, NULL, NULL);
ogs_assert(ret == 0);
memset(&data, 0, sizeof(data));
data.app = ogs_diam_gx_application;
ret = fd_disp_register(pcrf_gx_fb_cb, DISP_HOW_APPID, &data, NULL,
memset(&data, 0, sizeof(data));
data.app = ogs_diam_gx_application;
ret = fd_disp_register(pcrf_gx_fb_cb, DISP_HOW_APPID, &data, NULL,
&hdl_gx_fb);
ogs_assert(ret == 0);
data.command = ogs_diam_gx_cmd_ccr;
ret = fd_disp_register(pcrf_gx_ccr_cb, DISP_HOW_CC, &data, NULL,
data.command = ogs_diam_gx_cmd_ccr;
ret = fd_disp_register(pcrf_gx_ccr_cb, DISP_HOW_CC, &data, NULL,
&hdl_gx_ccr);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_gx_application, ogs_diam_vendor, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_gx_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return OGS_OK;
return OGS_OK;
}
void pcrf_gx_final(void)
{
int ret;
ret = fd_sess_handler_destroy(&pcrf_gx_reg, NULL);
ret = fd_sess_handler_destroy(&pcrf_gx_reg, NULL);
ogs_assert(ret == 0);
if (hdl_gx_fb)
(void) fd_disp_unregister(&hdl_gx_fb, NULL);
if (hdl_gx_ccr)
(void) fd_disp_unregister(&hdl_gx_ccr, NULL);
if (hdl_gx_fb)
(void) fd_disp_unregister(&hdl_gx_fb, NULL);
if (hdl_gx_ccr)
(void) fd_disp_unregister(&hdl_gx_ccr, NULL);
ogs_pool_final(&sess_state_pool);
ogs_pool_final(&rx_sess_state_pool);

View File

@ -43,7 +43,7 @@ int pcrf_initialize(void)
initialized = 1;
return OGS_OK;
return OGS_OK;
}
void pcrf_terminate(void)
@ -54,6 +54,6 @@ void pcrf_terminate(void)
ogs_dbi_final();
pcrf_context_final();
return;
return;
}

View File

@ -81,10 +81,10 @@ static void state_cleanup(struct sess_state *sess_data, os0_t sid, void *opaque)
static int pcrf_rx_fb_cb(struct msg **msg, struct avp *avp,
struct session *sess, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
}
static int pcrf_rx_aar_cb( struct msg **msg, struct avp *avp,
@ -93,7 +93,7 @@ static int pcrf_rx_aar_cb( struct msg **msg, struct avp *avp,
int rv;
int ret;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp *avpch1, *avpch2, *avpch3;
struct avp_hdr *hdr;
union avp_value val;
@ -110,7 +110,7 @@ static int pcrf_rx_aar_cb( struct msg **msg, struct avp *avp,
uint32_t result_code = OGS_DIAM_RX_DIAMETER_IP_CAN_SESSION_NOT_AVAILABLE;
ogs_debug("[PCRF] AA-Request");
ogs_assert(msg);
ogs_assert(sess);
@ -129,9 +129,9 @@ static int pcrf_rx_aar_cb( struct msg **msg, struct avp *avp,
memset(&rx_message, 0, sizeof(ogs_diam_rx_message_t));
rx_message.cmd_code = OGS_DIAM_RX_CMD_CODE_AA;
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -359,8 +359,8 @@ static int pcrf_rx_aar_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Store this value in the session */
@ -368,16 +368,16 @@ static int pcrf_rx_aar_cb( struct msg **msg, struct avp *avp,
ogs_assert(ret == 0);
ogs_assert(sess_data == NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("[PCRF] AA-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_ims_data_free(&rx_message.ims_data);
@ -401,7 +401,7 @@ out:
ogs_assert(ret == 0);
}
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
state_cleanup(sess_data, NULL, NULL);
@ -604,7 +604,7 @@ static int pcrf_rx_str_cb( struct msg **msg, struct avp *avp,
int rv;
int ret;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp_hdr *hdr;
union avp_value val;
struct sess_state *sess_data = NULL;
@ -614,7 +614,7 @@ static int pcrf_rx_str_cb( struct msg **msg, struct avp *avp,
uint32_t result_code = OGS_DIAM_RX_DIAMETER_IP_CAN_SESSION_NOT_AVAILABLE;
ogs_debug("[PCRF] Session-Termination-Request");
ogs_assert(msg);
ogs_assert(sess);
@ -628,9 +628,9 @@ static int pcrf_rx_str_cb( struct msg **msg, struct avp *avp,
memset(&rx_message, 0, sizeof(ogs_diam_rx_message_t));
rx_message.cmd_code = OGS_DIAM_RX_CMD_CODE_SESSION_TERMINATION;
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -684,20 +684,20 @@ static int pcrf_rx_str_cb( struct msg **msg, struct avp *avp,
}
}
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("[PCRF] Session-Termination-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
state_cleanup(sess_data, NULL, NULL);
ogs_ims_data_free(&rx_message.ims_data);
@ -723,7 +723,7 @@ out:
ogs_assert(ret == 0);
}
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("[PCRF] Session-Termination-Answer");
@ -736,59 +736,59 @@ out:
int pcrf_rx_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
ogs_thread_mutex_init(&sess_state_mutex);
ogs_pool_init(&sess_state_pool, ogs_app()->pool.sess);
/* Install objects definitions for this application */
ret = ogs_diam_rx_init();
/* Install objects definitions for this application */
ret = ogs_diam_rx_init();
ogs_assert(ret == 0);
/* Create handler for sessions */
ret = fd_sess_handler_create(&pcrf_rx_reg, state_cleanup, NULL, NULL);
ret = fd_sess_handler_create(&pcrf_rx_reg, state_cleanup, NULL, NULL);
ogs_assert(ret == 0);
/* Fallback CB if command != unexpected message received */
memset(&data, 0, sizeof(data));
data.app = ogs_diam_rx_application;
ret = fd_disp_register(pcrf_rx_fb_cb, DISP_HOW_APPID, &data, NULL,
/* Fallback CB if command != unexpected message received */
memset(&data, 0, sizeof(data));
data.app = ogs_diam_rx_application;
ret = fd_disp_register(pcrf_rx_fb_cb, DISP_HOW_APPID, &data, NULL,
&hdl_rx_fb);
ogs_assert(ret == 0);
/* Specific handler for AA-Request */
data.command = ogs_diam_rx_cmd_aar;
ret = fd_disp_register(pcrf_rx_aar_cb, DISP_HOW_CC, &data, NULL,
/* Specific handler for AA-Request */
data.command = ogs_diam_rx_cmd_aar;
ret = fd_disp_register(pcrf_rx_aar_cb, DISP_HOW_CC, &data, NULL,
&hdl_rx_aar);
ogs_assert(ret == 0);
/* Specific handler for STR-Request */
data.command = ogs_diam_rx_cmd_str;
ret = fd_disp_register(pcrf_rx_str_cb, DISP_HOW_CC, &data, NULL,
/* Specific handler for STR-Request */
data.command = ogs_diam_rx_cmd_str;
ret = fd_disp_register(pcrf_rx_str_cb, DISP_HOW_CC, &data, NULL,
&hdl_rx_str);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_rx_application, ogs_diam_vendor, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_rx_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return OGS_OK;
return OGS_OK;
}
void pcrf_rx_final(void)
{
int ret;
ret = fd_sess_handler_destroy(&pcrf_rx_reg, NULL);
ret = fd_sess_handler_destroy(&pcrf_rx_reg, NULL);
ogs_assert(ret == 0);
if (hdl_rx_fb)
(void) fd_disp_unregister(&hdl_rx_fb, NULL);
if (hdl_rx_aar)
(void) fd_disp_unregister(&hdl_rx_aar, NULL);
if (hdl_rx_str)
(void) fd_disp_unregister(&hdl_rx_str, NULL);
if (hdl_rx_fb)
(void) fd_disp_unregister(&hdl_rx_fb, NULL);
if (hdl_rx_aar)
(void) fd_disp_unregister(&hdl_rx_aar, NULL);
if (hdl_rx_str)
(void) fd_disp_unregister(&hdl_rx_str, NULL);
ogs_pool_final(&sess_state_pool);
ogs_thread_mutex_destroy(&sess_state_mutex);

View File

@ -2648,22 +2648,22 @@ static const uint8_t *ipcp_contains_option(
const ogs_pco_ipcp_t *ipcp, size_t ipcp_len,
enum ogs_pco_ipcp_options opt, size_t opt_minlen)
{
const uint8_t *cur_opt = (const uint8_t *)ipcp->options;
const uint8_t *cur_opt = (const uint8_t *)ipcp->options;
/* iterate over Options and check if protocol contained */
while (cur_opt + sizeof(struct ogs_pco_ipcp_options_s) <=
/* iterate over Options and check if protocol contained */
while (cur_opt + sizeof(struct ogs_pco_ipcp_options_s) <=
(uint8_t*)ipcp + ipcp_len) {
const struct ogs_pco_ipcp_options_s *cur_opt_hdr =
const struct ogs_pco_ipcp_options_s *cur_opt_hdr =
(const struct ogs_pco_ipcp_options_s *)cur_opt;
/* length value includes 2 bytes type/length */
if (cur_opt_hdr->len < 2)
return NULL;
if (cur_opt_hdr->type == opt &&
cur_opt_hdr->len >= 2 + opt_minlen)
return cur_opt;
cur_opt += cur_opt_hdr->len;
}
return NULL;
/* length value includes 2 bytes type/length */
if (cur_opt_hdr->len < 2)
return NULL;
if (cur_opt_hdr->type == opt &&
cur_opt_hdr->len >= 2 + opt_minlen)
return cur_opt;
cur_opt += cur_opt_hdr->len;
}
return NULL;
}
#include "../version.h"

View File

@ -41,7 +41,7 @@ int smf_fd_init(void)
rv = smf_gy_init();
ogs_assert(rv == OGS_OK);
rv = ogs_diam_rx_init();
rv = ogs_diam_rx_init();
ogs_assert(rv == 0);
rv = smf_s6b_init();
ogs_assert(rv == OGS_OK);
@ -49,7 +49,7 @@ int smf_fd_init(void)
rv = ogs_diam_start();
ogs_assert(rv == 0);
return OGS_OK;
return OGS_OK;
}
void smf_fd_final(void)

View File

@ -295,8 +295,8 @@ uint8_t smf_gn_handle_create_pdp_context_request(
}
ogs_info("UE IMSI[%s] APN[%s] IPv4[%s] IPv6[%s]",
smf_ue->imsi_bcd,
sess->session.name,
smf_ue->imsi_bcd,
sess->session.name,
sess->ipv4 ? OGS_INET_NTOP(&sess->ipv4->addr, buf1) : "",
sess->ipv6 ? OGS_INET6_NTOP(&sess->ipv6->addr, buf2) : "");

View File

@ -116,7 +116,7 @@ void smf_gx_send_ccr(smf_sess_t *sess, ogs_gtp_xact_t *xact,
if (sess->gx_sid) {
/* Retrieve session by Session-Id */
size_t sidlen = strlen(sess->gx_sid);
ret = fd_sess_fromsid_msg((os0_t)sess->gx_sid, sidlen, &session, &new);
ret = fd_sess_fromsid_msg((os0_t)sess->gx_sid, sidlen, &session, &new);
ogs_assert(ret == 0);
ogs_assert(new == 0);
@ -1097,10 +1097,10 @@ out:
static int smf_gx_fb_cb(struct msg **msg, struct avp *avp,
struct session *sess, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
return ENOTSUP;
}
static int smf_gx_rar_cb( struct msg **msg, struct avp *avp,
@ -1109,7 +1109,7 @@ static int smf_gx_rar_cb( struct msg **msg, struct avp *avp,
int rv;
int ret;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp *avpch1;
struct avp_hdr *hdr;
union avp_value val;
@ -1132,9 +1132,9 @@ static int smf_gx_rar_cb( struct msg **msg, struct avp *avp,
/* Set Credit Control Command */
gx_message->cmd_code = OGS_DIAM_GX_CMD_RE_AUTH;
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -1284,8 +1284,8 @@ static int smf_gx_rar_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Store this value in the session */
@ -1293,16 +1293,16 @@ static int smf_gx_rar_cb( struct msg **msg, struct avp *avp,
ogs_assert(ret == 0);
ogs_assert(sess_data == NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("Re-Auth-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
return 0;
@ -1332,49 +1332,49 @@ out:
int smf_gx_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
ogs_thread_mutex_init(&sess_state_mutex);
ogs_pool_init(&sess_state_pool, ogs_app()->pool.sess);
/* Install objects definitions for this application */
ret = ogs_diam_gx_init();
/* Install objects definitions for this application */
ret = ogs_diam_gx_init();
ogs_assert(ret == 0);
/* Create handler for sessions */
ret = fd_sess_handler_create(&smf_gx_reg, state_cleanup, NULL, NULL);
ret = fd_sess_handler_create(&smf_gx_reg, state_cleanup, NULL, NULL);
ogs_assert(ret == 0);
memset(&data, 0, sizeof(data));
data.app = ogs_diam_gx_application;
memset(&data, 0, sizeof(data));
data.app = ogs_diam_gx_application;
ret = fd_disp_register(smf_gx_fb_cb, DISP_HOW_APPID, &data, NULL,
ret = fd_disp_register(smf_gx_fb_cb, DISP_HOW_APPID, &data, NULL,
&hdl_gx_fb);
ogs_assert(ret == 0);
data.command = ogs_diam_gx_cmd_rar;
ret = fd_disp_register(smf_gx_rar_cb, DISP_HOW_CC, &data, NULL,
data.command = ogs_diam_gx_cmd_rar;
ret = fd_disp_register(smf_gx_rar_cb, DISP_HOW_CC, &data, NULL,
&hdl_gx_rar);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_gx_application, ogs_diam_vendor, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_gx_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return OGS_OK;
return OGS_OK;
}
void smf_gx_final(void)
{
int ret;
ret = fd_sess_handler_destroy(&smf_gx_reg, NULL);
ret = fd_sess_handler_destroy(&smf_gx_reg, NULL);
ogs_assert(ret == 0);
if (hdl_gx_fb)
(void) fd_disp_unregister(&hdl_gx_fb, NULL);
if (hdl_gx_rar)
(void) fd_disp_unregister(&hdl_gx_rar, NULL);
if (hdl_gx_fb)
(void) fd_disp_unregister(&hdl_gx_fb, NULL);
if (hdl_gx_rar)
(void) fd_disp_unregister(&hdl_gx_rar, NULL);
ogs_pool_final(&sess_state_pool);
ogs_thread_mutex_destroy(&sess_state_mutex);

View File

@ -582,7 +582,7 @@ void smf_gy_send_ccr(smf_sess_t *sess, void *xact,
if (sess->gy_sid) {
/* Retrieve session by Session-Id */
size_t sidlen = strlen(sess->gy_sid);
ret = fd_sess_fromsid_msg((os0_t)sess->gy_sid, sidlen, &session, &new);
ret = fd_sess_fromsid_msg((os0_t)sess->gy_sid, sidlen, &session, &new);
ogs_assert(ret == 0);
ogs_assert(new == 0);
@ -1175,10 +1175,10 @@ out:
static int smf_gy_fb_cb(struct msg **msg, struct avp *avp,
struct session *sess, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
return ENOTSUP;
}
static int smf_gy_rar_cb( struct msg **msg, struct avp *avp,
@ -1187,7 +1187,7 @@ static int smf_gy_rar_cb( struct msg **msg, struct avp *avp,
int rv;
int ret;
struct msg *ans;
struct msg *ans;
union avp_value val;
struct sess_state *sess_data = NULL;
@ -1207,8 +1207,8 @@ static int smf_gy_rar_cb( struct msg **msg, struct avp *avp,
/* Set Credit Control Command */
gy_message->cmd_code = OGS_DIAM_GY_CMD_RE_AUTH;
/* Create answer header */
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -1249,8 +1249,8 @@ static int smf_gy_rar_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Store this value in the session */
@ -1258,16 +1258,16 @@ static int smf_gy_rar_cb( struct msg **msg, struct avp *avp,
ogs_assert(ret == 0);
ogs_assert(sess_data == NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_debug("Re-Auth-Answer");
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
return 0;
@ -1296,49 +1296,49 @@ out:
int smf_gy_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
ogs_thread_mutex_init(&sess_state_mutex);
ogs_pool_init(&sess_state_pool, ogs_app()->pool.sess);
/* Install objects definitions for this application */
ret = ogs_diam_gy_init();
/* Install objects definitions for this application */
ret = ogs_diam_gy_init();
ogs_assert(ret == 0);
/* Create handler for sessions */
ret = fd_sess_handler_create(&smf_gy_reg, state_cleanup, NULL, NULL);
ret = fd_sess_handler_create(&smf_gy_reg, state_cleanup, NULL, NULL);
ogs_assert(ret == 0);
memset(&data, 0, sizeof(data));
data.app = ogs_diam_gy_application;
memset(&data, 0, sizeof(data));
data.app = ogs_diam_gy_application;
ret = fd_disp_register(smf_gy_fb_cb, DISP_HOW_APPID, &data, NULL,
ret = fd_disp_register(smf_gy_fb_cb, DISP_HOW_APPID, &data, NULL,
&hdl_gy_fb);
ogs_assert(ret == 0);
data.command = ogs_diam_gy_cmd_rar;
ret = fd_disp_register(smf_gy_rar_cb, DISP_HOW_CC, &data, NULL,
data.command = ogs_diam_gy_cmd_rar;
ret = fd_disp_register(smf_gy_rar_cb, DISP_HOW_CC, &data, NULL,
&hdl_gy_rar);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_gy_application, NULL, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_gy_application, NULL, 1, 0);
ogs_assert(ret == 0);
return OGS_OK;
return OGS_OK;
}
void smf_gy_final(void)
{
int ret;
ret = fd_sess_handler_destroy(&smf_gy_reg, NULL);
ret = fd_sess_handler_destroy(&smf_gy_reg, NULL);
ogs_assert(ret == 0);
if (hdl_gy_fb)
(void) fd_disp_unregister(&hdl_gy_fb, NULL);
if (hdl_gy_rar)
(void) fd_disp_unregister(&hdl_gy_rar, NULL);
if (hdl_gy_fb)
(void) fd_disp_unregister(&hdl_gy_fb, NULL);
if (hdl_gy_rar)
(void) fd_disp_unregister(&hdl_gy_rar, NULL);
ogs_pool_final(&sess_state_pool);
ogs_thread_mutex_destroy(&sess_state_mutex);

View File

@ -493,7 +493,7 @@ bool smf_npcf_smpolicycontrol_handle_create(
&ul_pdr->ue_ip_addr, &ul_pdr->ue_ip_addr_len));
ogs_info("UE SUPI[%s] DNN[%s] IPv4[%s] IPv6[%s]",
smf_ue->supi, sess->session.name,
smf_ue->supi, sess->session.name,
sess->ipv4 ? OGS_INET_NTOP(&sess->ipv4->addr, buf1) : "",
sess->ipv6 ? OGS_INET6_NTOP(&sess->ipv6->addr, buf2) : "");

View File

@ -253,8 +253,8 @@ uint8_t smf_s5c_handle_create_session_request(
ogs_assert(OGS_PFCP_CAUSE_REQUEST_ACCEPTED == smf_sess_set_ue_ip(sess));
ogs_info("UE IMSI[%s] APN[%s] IPv4[%s] IPv6[%s]",
smf_ue->imsi_bcd,
sess->session.name,
smf_ue->imsi_bcd,
sess->session.name,
sess->ipv4 ? OGS_INET_NTOP(&sess->ipv4->addr, buf1) : "",
sess->ipv6 ? OGS_INET6_NTOP(&sess->ipv6->addr, buf2) : "");

View File

@ -65,10 +65,10 @@ static void state_cleanup(struct sess_state *sess_data, os0_t sid, void *opaque)
static int smf_s6b_fb_cb(struct msg **msg, struct avp *avp,
struct session *sess, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
return ENOTSUP;
}
void smf_s6b_send_aar(smf_sess_t *sess, ogs_gtp_xact_t *xact)
@ -111,7 +111,7 @@ void smf_s6b_send_aar(smf_sess_t *sess, ogs_gtp_xact_t *xact)
if (sess->s6b_sid) {
/* Retrieve session by Session-Id */
size_t sidlen = strlen(sess->s6b_sid);
ret = fd_sess_fromsid_msg((os0_t)sess->s6b_sid, sidlen, &session, &new);
ret = fd_sess_fromsid_msg((os0_t)sess->s6b_sid, sidlen, &session, &new);
ogs_assert(ret == 0);
ogs_assert(new == 0);
@ -772,42 +772,42 @@ static void smf_s6b_sta_cb(void *data, struct msg **msg)
int smf_s6b_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
ogs_thread_mutex_init(&sess_state_mutex);
ogs_pool_init(&sess_state_pool, ogs_app()->pool.sess);
/* Install objects definitions for this application */
ret = ogs_diam_s6b_init();
/* Install objects definitions for this application */
ret = ogs_diam_s6b_init();
ogs_assert(ret == 0);
/* Create handler for sessions */
ret = fd_sess_handler_create(&smf_s6b_reg, state_cleanup, NULL, NULL);
ret = fd_sess_handler_create(&smf_s6b_reg, state_cleanup, NULL, NULL);
ogs_assert(ret == 0);
memset(&data, 0, sizeof(data));
data.app = ogs_diam_s6b_application;
memset(&data, 0, sizeof(data));
data.app = ogs_diam_s6b_application;
ret = fd_disp_register(smf_s6b_fb_cb, DISP_HOW_APPID, &data, NULL,
ret = fd_disp_register(smf_s6b_fb_cb, DISP_HOW_APPID, &data, NULL,
&hdl_s6b_fb);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_s6b_application, ogs_diam_vendor, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_s6b_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return OGS_OK;
return OGS_OK;
}
void smf_s6b_final(void)
{
int ret;
ret = fd_sess_handler_destroy(&smf_s6b_reg, NULL);
ret = fd_sess_handler_destroy(&smf_s6b_reg, NULL);
ogs_assert(ret == 0);
if (hdl_s6b_fb)
(void) fd_disp_unregister(&hdl_s6b_fb, NULL);
if (hdl_s6b_fb)
(void) fd_disp_unregister(&hdl_s6b_fb, NULL);
ogs_pool_final(&sess_state_pool);
ogs_thread_mutex_destroy(&sess_state_mutex);

View File

@ -301,8 +301,8 @@ ogs_pkbuf_t *testemm_build_authentication_response(test_ue_t *test_ue)
milenage_f2345(test_ue->opc, test_ue->k, test_ue->rand,
res, ck, ik, ak, NULL);
for (i = 0; i < 6; i++)
sqn[i] = test_ue->autn[i] ^ ak[i];
for (i = 0; i < 6; i++)
sqn[i] = test_ue->autn[i] ^ ak[i];
ogs_nas_from_plmn_id(&nas_plmn_id, &test_ue->e_tai.plmn_id);
ogs_auc_kasme(ck, ik, &nas_plmn_id, sqn, ak, test_ue->kasme);

View File

@ -1717,10 +1717,10 @@ ogs_pkbuf_t *test_s1ap_build_enb_status_transfer(test_ue_t *test_ue)
S1AP_ENB_UE_S1AP_ID_t *ENB_UE_S1AP_ID = NULL;
S1AP_ENB_StatusTransfer_TransparentContainer_t
*ENB_StatusTransfer_TransparentContainer = NULL;
S1AP_Bearers_SubjectToStatusTransferList_t
S1AP_Bearers_SubjectToStatusTransferList_t
*Bearers_SubjectToStatusTransferList = NULL;
S1AP_Bearers_SubjectToStatusTransfer_ItemIEs_t *ie2 = NULL;
S1AP_Bearers_SubjectToStatusTransfer_Item_t *item = NULL;
S1AP_Bearers_SubjectToStatusTransfer_ItemIEs_t *ie2 = NULL;
S1AP_Bearers_SubjectToStatusTransfer_Item_t *item = NULL;
ogs_assert(test_ue);

View File

@ -305,7 +305,7 @@ void ogs_tlv_test_check_embed_ogs_tlv_test(abts_case *tc, ogs_tlv_t *root_tlv, i
ogs_tlv_free_all(parsed_tlv);
ABTS_INT_EQUAL(tc, ogs_tlv_pool_avail(), ogs_core()->tlv.pool);
return;
return;
}
/* basic encoding/decoding/finding Test */
@ -467,7 +467,7 @@ static void test2_func(abts_case *tc, void *data)
ogs_tlv_test_check_embed_ogs_tlv_test(tc, root_tlv, mode);
return;
return;
}
@ -858,23 +858,23 @@ abts_suite *test_tlv(abts_suite *suite)
abts_run_test(suite, test1_func, (void*)OGS_TLV_MODE_T2_L2);
abts_run_test(suite, test2_func, (void*)OGS_TLV_MODE_T2_L2);
abts_run_test(suite, test3_func, (void*)OGS_TLV_MODE_T2_L2);
abts_run_test(suite, test4_func, (void*)OGS_TLV_MODE_T2_L2);
abts_run_test(suite, test5_func, (void*)OGS_TLV_MODE_T2_L2);
abts_run_test(suite, test3_func, (void*)OGS_TLV_MODE_T2_L2);
abts_run_test(suite, test4_func, (void*)OGS_TLV_MODE_T2_L2);
abts_run_test(suite, test5_func, (void*)OGS_TLV_MODE_T2_L2);
abts_run_test(suite, test1_func, (void*)OGS_TLV_MODE_T1_L1);
abts_run_test(suite, test5_func, (void*)OGS_TLV_MODE_T1_L1);
abts_run_test(suite, test1_func, (void*)OGS_TLV_MODE_T1_L2);
abts_run_test(suite, test2_func, (void*)OGS_TLV_MODE_T1_L2);
abts_run_test(suite, test3_func, (void*)OGS_TLV_MODE_T1_L2);
abts_run_test(suite, test4_func, (void*)OGS_TLV_MODE_T1_L2);
abts_run_test(suite, test5_func, (void*)OGS_TLV_MODE_T1_L2);
abts_run_test(suite, test3_func, (void*)OGS_TLV_MODE_T1_L2);
abts_run_test(suite, test4_func, (void*)OGS_TLV_MODE_T1_L2);
abts_run_test(suite, test5_func, (void*)OGS_TLV_MODE_T1_L2);
abts_run_test(suite, test1_func, (void*)OGS_TLV_MODE_T1_L2_I1);
abts_run_test(suite, test2_func, (void*)OGS_TLV_MODE_T1_L2_I1);
abts_run_test(suite, test3_func, (void*)OGS_TLV_MODE_T1_L2_I1);
abts_run_test(suite, test4_func, (void*)OGS_TLV_MODE_T1_L2_I1);
abts_run_test(suite, test5_func, (void*)OGS_TLV_MODE_T1_L2_I1);
abts_run_test(suite, test3_func, (void*)OGS_TLV_MODE_T1_L2_I1);
abts_run_test(suite, test4_func, (void*)OGS_TLV_MODE_T1_L2_I1);
abts_run_test(suite, test5_func, (void*)OGS_TLV_MODE_T1_L2_I1);
abts_run_test(suite, test6_func, NULL);
abts_run_test(suite, test6_func, NULL);
return suite;
}

View File

@ -69,10 +69,10 @@ static void state_cleanup(struct sess_state *sess_data, os0_t sid, void *opaque)
static int test_s6b_fb_cb(struct msg **msg, struct avp *avp,
struct session *sess, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
}
static int test_s6b_aar_cb( struct msg **msg, struct avp *avp,
@ -81,7 +81,7 @@ static int test_s6b_aar_cb( struct msg **msg, struct avp *avp,
int rv;
int ret = 0, i;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp *avpch1, *avpch2;
struct avp_hdr *hdr;
union avp_value val;
@ -91,9 +91,9 @@ static int test_s6b_aar_cb( struct msg **msg, struct avp *avp,
ogs_assert(msg);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -151,8 +151,8 @@ static int test_s6b_aar_cb( struct msg **msg, struct avp *avp,
ret = fd_msg_avp_add(ans, MSG_BRW_LAST_CHILD, avp);
ogs_assert(ret == 0);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Store this value in the session */
@ -160,19 +160,19 @@ static int test_s6b_aar_cb( struct msg **msg, struct avp *avp,
ogs_assert(ret == 0);
ogs_assert(sess_data == NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) ==0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) ==0);
return 0;
out:
/* Set the Result-Code */
/* Set the Result-Code */
if (result_code == OGS_DIAM_AVP_UNSUPPORTED) {
ret = fd_msg_rescode_set(ans,
(char *)"DIAMETER_AVP_UNSUPPORTED", NULL, NULL, 1);
@ -196,7 +196,7 @@ out:
ogs_assert(sess_data == NULL);
}
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
return 0;
@ -208,7 +208,7 @@ static int test_s6b_str_cb( struct msg **msg, struct avp *avp,
int rv;
int ret = 0, i;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp *avpch1, *avpch2;
struct avp_hdr *hdr;
union avp_value val;
@ -218,9 +218,9 @@ static int test_s6b_str_cb( struct msg **msg, struct avp *avp,
ogs_assert(msg);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -251,8 +251,8 @@ static int test_s6b_str_cb( struct msg **msg, struct avp *avp,
goto out;
}
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char *)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Store this value in the session */
@ -260,19 +260,19 @@ static int test_s6b_str_cb( struct msg **msg, struct avp *avp,
ogs_assert(ret == 0);
ogs_assert(sess_data == NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) ==0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) ==0);
return 0;
out:
/* Set the Result-Code */
/* Set the Result-Code */
if (result_code == OGS_DIAM_AVP_UNSUPPORTED) {
ret = fd_msg_rescode_set(ans,
(char *)"DIAMETER_AVP_UNSUPPORTED", NULL, NULL, 1);
@ -296,7 +296,7 @@ out:
ogs_assert(sess_data == NULL);
}
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
return 0;
@ -305,57 +305,57 @@ out:
int test_s6b_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
ogs_thread_mutex_init(&sess_state_mutex);
ogs_pool_init(&sess_state_pool, ogs_app()->pool.sess);
/* Install objects definitions for this application */
ret = ogs_diam_s6b_init();
/* Install objects definitions for this application */
ret = ogs_diam_s6b_init();
ogs_assert(ret == 0);
/* Create handler for sessions */
ret = fd_sess_handler_create(&test_s6b_reg, &state_cleanup, NULL, NULL);
ret = fd_sess_handler_create(&test_s6b_reg, &state_cleanup, NULL, NULL);
ogs_assert(ret == 0);
/* Fallback CB if command != unexpected message received */
memset(&data, 0, sizeof(data));
data.app = ogs_diam_s6b_application;
/* Fallback CB if command != unexpected message received */
memset(&data, 0, sizeof(data));
data.app = ogs_diam_s6b_application;
ret = fd_disp_register(test_s6b_fb_cb, DISP_HOW_APPID, &data, NULL,
ret = fd_disp_register(test_s6b_fb_cb, DISP_HOW_APPID, &data, NULL,
&hdl_s6b_fb);
ogs_assert(ret == 0);
data.command = ogs_diam_rx_cmd_aar;
ret = fd_disp_register(test_s6b_aar_cb, DISP_HOW_CC, &data, NULL,
data.command = ogs_diam_rx_cmd_aar;
ret = fd_disp_register(test_s6b_aar_cb, DISP_HOW_CC, &data, NULL,
&hdl_s6b_aar);
ogs_assert(ret == 0);
data.command = ogs_diam_rx_cmd_str;
ret = fd_disp_register(test_s6b_str_cb, DISP_HOW_CC, &data, NULL,
data.command = ogs_diam_rx_cmd_str;
ret = fd_disp_register(test_s6b_str_cb, DISP_HOW_CC, &data, NULL,
&hdl_s6b_str);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_s6b_application, ogs_diam_vendor, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_s6b_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return 0;
return 0;
}
void test_s6b_final(void)
{
int ret;
ret = fd_sess_handler_destroy(&test_s6b_reg, NULL);
ret = fd_sess_handler_destroy(&test_s6b_reg, NULL);
ogs_assert(ret == OGS_OK);
if (hdl_s6b_fb)
(void) fd_disp_unregister(&hdl_s6b_fb, NULL);
if (hdl_s6b_aar)
(void) fd_disp_unregister(&hdl_s6b_aar, NULL);
if (hdl_s6b_str)
(void) fd_disp_unregister(&hdl_s6b_str, NULL);
if (hdl_s6b_fb)
(void) fd_disp_unregister(&hdl_s6b_fb, NULL);
if (hdl_s6b_aar)
(void) fd_disp_unregister(&hdl_s6b_aar, NULL);
if (hdl_s6b_str)
(void) fd_disp_unregister(&hdl_s6b_str, NULL);
ogs_pool_final(&sess_state_pool);
ogs_thread_mutex_destroy(&sess_state_mutex);

View File

@ -57,10 +57,10 @@ static void state_cleanup(struct sess_state *sess_data, os0_t sid, void *opaque)
static int test_swx_fb_cb(struct msg **msg, struct avp *avp,
struct session *sess, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
}
void test_swx_send(test_sess_t *sess, bool handover_ind,
@ -629,38 +629,38 @@ static void test_swx_saa_cb(void *data, struct msg **msg)
int test_swx_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
/* Install objects definitions for this application */
ret = ogs_diam_swx_init();
/* Install objects definitions for this application */
ret = ogs_diam_swx_init();
ogs_assert(ret == 0);
/* Create handler for sessions */
ret = fd_sess_handler_create(&test_swx_reg, &state_cleanup, NULL, NULL);
ret = fd_sess_handler_create(&test_swx_reg, &state_cleanup, NULL, NULL);
ogs_assert(ret == 0);
/* Fallback CB if command != unexpected message received */
memset(&data, 0, sizeof(data));
data.app = ogs_diam_swx_application;
/* Fallback CB if command != unexpected message received */
memset(&data, 0, sizeof(data));
data.app = ogs_diam_swx_application;
ret = fd_disp_register(test_swx_fb_cb, DISP_HOW_APPID, &data, NULL,
ret = fd_disp_register(test_swx_fb_cb, DISP_HOW_APPID, &data, NULL,
&hdl_swx_fb);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_swx_application, ogs_diam_vendor, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_swx_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return 0;
return 0;
}
void test_swx_final(void)
{
int ret;
ret = fd_sess_handler_destroy(&test_swx_reg, NULL);
ret = fd_sess_handler_destroy(&test_swx_reg, NULL);
ogs_assert(ret == OGS_OK);
if (hdl_swx_fb)
(void) fd_disp_unregister(&hdl_swx_fb, NULL);
if (hdl_swx_fb)
(void) fd_disp_unregister(&hdl_swx_fb, NULL);
}

View File

@ -59,11 +59,11 @@ ogs_pkbuf_t *test_s2b_build_create_session_request(
memset(&gtp_message, 0, sizeof(ogs_gtp2_message_t));
if (handover_ind == true) {
memset(&indication, 0, sizeof(ogs_gtp2_indication_t));
indication.handover_indication = 1;
req->indication_flags.presence = 1;
req->indication_flags.data = &indication;
req->indication_flags.len = sizeof(ogs_gtp2_indication_t);
memset(&indication, 0, sizeof(ogs_gtp2_indication_t));
indication.handover_indication = 1;
req->indication_flags.presence = 1;
req->indication_flags.data = &indication;
req->indication_flags.len = sizeof(ogs_gtp2_indication_t);
}
ogs_assert(test_ue->imsi_len);

View File

@ -69,18 +69,18 @@ static void test_diam_config(void)
int test_fd_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
test_diam_config();
ret = ogs_diam_init(FD_MODE_CLIENT, NULL, &diam_config);
ogs_assert(ret == 0);
ret = ogs_diam_s6a_init();
ret = ogs_diam_s6a_init();
ogs_assert(ret == 0);
ret = ogs_diam_cx_init();
ret = ogs_diam_cx_init();
ogs_assert(ret == 0);
ret = ogs_diam_rx_init();
ret = ogs_diam_rx_init();
ogs_assert(ret == 0);
test_swx_init();
@ -89,7 +89,7 @@ int test_fd_init(void)
ret = ogs_diam_start();
ogs_assert(ret == 0);
return 0;
return 0;
}
void test_fd_final(void)

View File

@ -22,11 +22,11 @@
static void sbi_message_test1(abts_case *tc, void *data)
{
cJSON *item = NULL;
cJSON *item = NULL;
OpenAPI_lnode_t *entry;
OpenAPI_nf_profile_t *nf_profile1;
OpenAPI_nf_profile_t *nf_profile2;
OpenAPI_nf_profile_t *nf_profile1;
OpenAPI_nf_profile_t *nf_profile2;
OpenAPI_udr_info_t *udr_info1;
OpenAPI_udr_info_t *udr_info2;
@ -41,9 +41,9 @@ static void sbi_message_test1(abts_case *tc, void *data)
nf_profile1 = ogs_calloc(1, sizeof(*nf_profile1));
ABTS_PTR_NOTNULL(tc, nf_profile1);
nf_profile1->nf_instance_id = "NF_INSTANCE_ID";
nf_profile1->nf_type = OpenAPI_nf_type_SMF;
nf_profile1->nf_status = OpenAPI_nf_status_REGISTERED;
nf_profile1->nf_instance_id = "NF_INSTANCE_ID";
nf_profile1->nf_type = OpenAPI_nf_type_SMF;
nf_profile1->nf_status = OpenAPI_nf_status_REGISTERED;
memset(plmn_id1, 0, sizeof(plmn_id1));
@ -83,7 +83,7 @@ static void sbi_message_test1(abts_case *tc, void *data)
identity_range1->end = "9";
OpenAPI_list_add(udr_info1->gpsi_ranges, identity_range1);
item = OpenAPI_nf_profile_convertToJSON(nf_profile1);
item = OpenAPI_nf_profile_convertToJSON(nf_profile1);
ABTS_PTR_NOTNULL(tc, item);
#if 0
@ -94,7 +94,7 @@ static void sbi_message_test1(abts_case *tc, void *data)
}
#endif
nf_profile2 = OpenAPI_nf_profile_parseFromJSON(item);
nf_profile2 = OpenAPI_nf_profile_parseFromJSON(item);
ABTS_PTR_NOTNULL(tc, nf_profile2);
ABTS_STR_EQUAL(tc,
@ -170,27 +170,27 @@ static void sbi_message_test1(abts_case *tc, void *data)
cJSON_Delete(item);
OpenAPI_nf_profile_free(nf_profile2);
OpenAPI_nf_profile_free(nf_profile2);
}
static void sbi_message_test2(abts_case *tc, void *data)
{
cJSON *item = NULL;
cJSON *item = NULL;
OpenAPI_lnode_t *entry;
OpenAPI_nf_group_cond_t *nf_group_cond1;
OpenAPI_nf_group_cond_t *nf_group_cond2;
OpenAPI_smf_info_t *smf_info1;
OpenAPI_smf_info_t *smf_info2;
OpenAPI_smf_info_t *smf_info1;
OpenAPI_smf_info_t *smf_info2;
OpenAPI_access_type_e access_type;
nf_group_cond1 = ogs_calloc(1, sizeof(*nf_group_cond1));
ABTS_PTR_NOTNULL(tc, nf_group_cond1);
nf_group_cond1->nf_type = OpenAPI_nf_group_cond_NFTYPE_UDR;
nf_group_cond1->nf_group_id = "group";
nf_group_cond1->nf_type = OpenAPI_nf_group_cond_NFTYPE_UDR;
nf_group_cond1->nf_group_id = "group";
item = OpenAPI_nf_group_cond_convertToJSON(nf_group_cond1);
item = OpenAPI_nf_group_cond_convertToJSON(nf_group_cond1);
ABTS_PTR_NOTNULL(tc, item);
#if 0
@ -201,7 +201,7 @@ static void sbi_message_test2(abts_case *tc, void *data)
}
#endif
nf_group_cond2 = OpenAPI_nf_group_cond_parseFromJSON(item);
nf_group_cond2 = OpenAPI_nf_group_cond_parseFromJSON(item);
ABTS_PTR_NOTNULL(tc, nf_group_cond2);
ABTS_STR_EQUAL(tc,
@ -218,7 +218,7 @@ static void sbi_message_test2(abts_case *tc, void *data)
smf_info1 = ogs_calloc(1, sizeof(*smf_info1));
ABTS_PTR_NOTNULL(tc, smf_info1);
smf_info1->s_nssai_smf_info_list = OpenAPI_list_create();
smf_info1->pgw_fqdn = "PGW_FQDN";
smf_info1->pgw_fqdn = "PGW_FQDN";
smf_info1->access_type = OpenAPI_list_create();
ABTS_PTR_NOTNULL(tc, smf_info1->access_type);
@ -226,7 +226,7 @@ static void sbi_message_test2(abts_case *tc, void *data)
(void*)OpenAPI_access_type_3GPP_ACCESS);
OpenAPI_list_add(smf_info1->access_type,
(void*)OpenAPI_access_type_NON_3GPP_ACCESS);
item = OpenAPI_smf_info_convertToJSON(smf_info1);
item = OpenAPI_smf_info_convertToJSON(smf_info1);
ABTS_PTR_NOTNULL(tc, item);
#if 0
@ -237,7 +237,7 @@ static void sbi_message_test2(abts_case *tc, void *data)
}
#endif
smf_info2 = OpenAPI_smf_info_parseFromJSON(item);
smf_info2 = OpenAPI_smf_info_parseFromJSON(item);
ABTS_PTR_NOTNULL(tc, smf_info2);
ABTS_STR_EQUAL(tc,
@ -270,11 +270,11 @@ static void sbi_message_test2(abts_case *tc, void *data)
static void sbi_message_test3(abts_case *tc, void *data)
{
cJSON *item = NULL;
cJSON *item = NULL;
OpenAPI_lnode_t *entry;
OpenAPI_nrf_info_t *nrf_info1;
OpenAPI_nrf_info_t *nrf_info2;
OpenAPI_nrf_info_t *nrf_info1;
OpenAPI_nrf_info_t *nrf_info2;
OpenAPI_map_t *served_pcf_info1 = NULL;
OpenAPI_map_t *served_pcf_info2 = NULL;
@ -301,7 +301,7 @@ static void sbi_message_test3(abts_case *tc, void *data)
OpenAPI_list_add(nrf_info1->served_pcf_info, served_pcf_info1);
OpenAPI_list_add(nrf_info1->served_pcf_info, served_pcf_info2);
item = OpenAPI_nrf_info_convertToJSON(nrf_info1);
item = OpenAPI_nrf_info_convertToJSON(nrf_info1);
ABTS_PTR_NOTNULL(tc, item);
#if 0
@ -317,7 +317,7 @@ static void sbi_message_test3(abts_case *tc, void *data)
ogs_free(pcf_info1);
ogs_free(pcf_info2);
nrf_info2 = OpenAPI_nrf_info_parseFromJSON(item);
nrf_info2 = OpenAPI_nrf_info_parseFromJSON(item);
ABTS_PTR_NOTNULL(tc, nrf_info2);
ABTS_INT_EQUAL(tc, nrf_info1->served_pcf_info->count,

View File

@ -63,10 +63,10 @@ static void state_cleanup(struct sess_state *sess_data, os0_t sid, void *opaque)
static int test_cx_fb_cb(struct msg **msg, struct avp *avp,
struct session *sess, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
}
void test_cx_send_uar(test_ue_t *test_ue, int id_type)
@ -485,8 +485,8 @@ static void test_cx_send_mar(struct sess_state *sess_data)
/* Set the Server-Name AVP */
ret = fd_msg_avp_new(ogs_diam_cx_server_name, 0, &avp);
ogs_assert(ret == 0);
val.os.data = (os0_t)fd_g_config->cnf_diamid;
val.os.len = fd_g_config->cnf_diamid_len;
val.os.data = (os0_t)fd_g_config->cnf_diamid;
val.os.len = fd_g_config->cnf_diamid_len;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
@ -735,8 +735,8 @@ static void test_cx_send_sar(struct sess_state *sess_data)
/* Set the Server-Name AVP */
ret = fd_msg_avp_new(ogs_diam_cx_server_name, 0, &avp);
ogs_assert(ret == 0);
val.os.data = (os0_t)fd_g_config->cnf_diamid;
val.os.len = fd_g_config->cnf_diamid_len;
val.os.data = (os0_t)fd_g_config->cnf_diamid;
val.os.len = fd_g_config->cnf_diamid_len;
ret = fd_msg_avp_setvalue(avp, &val);
ogs_assert(ret == 0);
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
@ -1129,38 +1129,38 @@ static void test_cx_lia_cb(void *data, struct msg **msg)
int test_cx_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
/* Install objects definitions for this application */
ret = ogs_diam_cx_init();
/* Install objects definitions for this application */
ret = ogs_diam_cx_init();
ogs_assert(ret == 0);
/* Create handler for sessions */
ret = fd_sess_handler_create(&test_cx_reg, &state_cleanup, NULL, NULL);
ret = fd_sess_handler_create(&test_cx_reg, &state_cleanup, NULL, NULL);
ogs_assert(ret == 0);
/* Fallback CB if command != unexpected message received */
memset(&data, 0, sizeof(data));
data.app = ogs_diam_cx_application;
/* Fallback CB if command != unexpected message received */
memset(&data, 0, sizeof(data));
data.app = ogs_diam_cx_application;
ret = fd_disp_register(test_cx_fb_cb, DISP_HOW_APPID, &data, NULL,
ret = fd_disp_register(test_cx_fb_cb, DISP_HOW_APPID, &data, NULL,
&hdl_cx_fb);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_cx_application, ogs_diam_vendor, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_cx_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return 0;
return 0;
}
void test_cx_final(void)
{
int ret;
ret = fd_sess_handler_destroy(&test_cx_reg, NULL);
ret = fd_sess_handler_destroy(&test_cx_reg, NULL);
ogs_assert(ret == OGS_OK);
if (hdl_cx_fb)
(void) fd_disp_unregister(&hdl_cx_fb, NULL);
if (hdl_cx_fb)
(void) fd_disp_unregister(&hdl_cx_fb, NULL);
}

View File

@ -60,10 +60,10 @@ static void state_cleanup(struct sess_state *sess_data, os0_t sid, void *opaque)
static int pcscf_rx_fb_cb(struct msg **msg, struct avp *avp,
struct session *sess, void *opaque, enum disp_action *act)
{
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
/* This CB should never be called */
ogs_warn("Unexpected message received!");
return ENOTSUP;
}
void test_rx_send_aar_audio(uint8_t **rx_sid,
@ -115,7 +115,7 @@ void test_rx_send_aar_audio(uint8_t **rx_sid,
if (*rx_sid) {
/* Retrieve session by Session-Id */
size_t sidlen = strlen((char *)*rx_sid);
ret = fd_sess_fromsid_msg(*rx_sid, sidlen, &session, &new);
ret = fd_sess_fromsid_msg(*rx_sid, sidlen, &session, &new);
ogs_assert(ret == 0);
ogs_assert(new == 0);
@ -612,7 +612,7 @@ void test_rx_send_aar_video(uint8_t **rx_sid, test_sess_t *sess, int id_type)
if (*rx_sid) {
/* Retrieve session by Session-Id */
size_t sidlen = strlen((char *)*rx_sid);
ret = fd_sess_fromsid_msg(*rx_sid, sidlen, &session, &new);
ret = fd_sess_fromsid_msg(*rx_sid, sidlen, &session, &new);
ogs_assert(ret == 0);
ogs_assert(new == 0);
@ -1290,7 +1290,7 @@ void test_rx_send_aar_ctrl(uint8_t **rx_sid, test_sess_t *sess, int id_type)
if (*rx_sid) {
/* Retrieve session by Session-Id */
size_t sidlen = strlen((char *)*rx_sid);
ret = fd_sess_fromsid_msg(*rx_sid, sidlen, &session, &new);
ret = fd_sess_fromsid_msg(*rx_sid, sidlen, &session, &new);
ogs_assert(ret == 0);
ogs_assert(new == 0);
@ -1789,7 +1789,7 @@ static int pcscf_rx_asr_cb( struct msg **msg, struct avp *avp,
int rv;
int ret;
struct msg *ans, *qry;
struct msg *ans, *qry;
struct avp *avpch1, *avpch2, *avpch3;
struct avp_hdr *hdr;
union avp_value val;
@ -1804,9 +1804,9 @@ static int pcscf_rx_asr_cb( struct msg **msg, struct avp *avp,
ogs_assert(ret == 0);
ogs_assert(sess_data);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
/* Create answer header */
qry = *msg;
ret = fd_msg_new_answer_from_req(fd_g_config->cnf_dict, msg, 0);
ogs_assert(ret == 0);
ans = *msg;
@ -1838,8 +1838,8 @@ static int pcscf_rx_asr_cb( struct msg **msg, struct avp *avp,
ogs_error("no_Abort-Cause ");
}
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
/* Set the Origin-Host, Origin-Realm, andResult-Code AVPs */
ret = fd_msg_rescode_set(ans, (char*)"DIAMETER_SUCCESS", NULL, NULL, 1);
ogs_assert(ret == 0);
/* Store this value in the session */
@ -1850,14 +1850,14 @@ static int pcscf_rx_asr_cb( struct msg **msg, struct avp *avp,
ogs_assert(ret == 0);
ogs_assert(sess_data == NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
/* Send the answer */
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
/* Add this value to the stats */
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
ogs_diam_logger_self()->stats.nb_echoed++;
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
test_rx_send_str(sid);
@ -2102,48 +2102,48 @@ out:
int test_rx_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
test_cx_init();
/* Install objects definitions for this application */
ret = ogs_diam_rx_init();
/* Install objects definitions for this application */
ret = ogs_diam_rx_init();
ogs_assert(ret == 0);
/* Create handler for sessions */
ret = fd_sess_handler_create(&pcscf_rx_reg, state_cleanup, NULL, NULL);
ret = fd_sess_handler_create(&pcscf_rx_reg, state_cleanup, NULL, NULL);
ogs_assert(ret == 0);
/* Fallback CB if command != unexpected message received */
memset(&data, 0, sizeof(data));
data.app = ogs_diam_rx_application;
/* Fallback CB if command != unexpected message received */
memset(&data, 0, sizeof(data));
data.app = ogs_diam_rx_application;
ret = fd_disp_register(pcscf_rx_fb_cb, DISP_HOW_APPID, &data, NULL,
ret = fd_disp_register(pcscf_rx_fb_cb, DISP_HOW_APPID, &data, NULL,
&hdl_rx_fb);
ogs_assert(ret == 0);
/* Specific handler for Abort-Session-Request */
data.command = ogs_diam_rx_cmd_asr;
ret = fd_disp_register(pcscf_rx_asr_cb, DISP_HOW_CC, &data, NULL,
/* Specific handler for Abort-Session-Request */
data.command = ogs_diam_rx_cmd_asr;
ret = fd_disp_register(pcscf_rx_asr_cb, DISP_HOW_CC, &data, NULL,
&hdl_rx_asr);
ogs_assert(ret == 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_rx_application, ogs_diam_vendor, 1, 0);
/* Advertise the support for the application in the peer */
ret = fd_disp_app_support(ogs_diam_rx_application, ogs_diam_vendor, 1, 0);
ogs_assert(ret == 0);
return 0;
return 0;
}
void test_rx_final(void)
{
int ret;
ret = fd_sess_handler_destroy(&pcscf_rx_reg, NULL);
ret = fd_sess_handler_destroy(&pcscf_rx_reg, NULL);
ogs_assert(ret == 0);
if (hdl_rx_fb)
(void) fd_disp_unregister(&hdl_rx_fb, NULL);
if (hdl_rx_asr)
(void) fd_disp_unregister(&hdl_rx_asr, NULL);
if (hdl_rx_fb)
(void) fd_disp_unregister(&hdl_rx_fb, NULL);
if (hdl_rx_asr)
(void) fd_disp_unregister(&hdl_rx_asr, NULL);
}

View File

@ -69,7 +69,7 @@ static void test_diam_config(void)
int test_fd_init(void)
{
int ret;
struct disp_when data;
struct disp_when data;
test_diam_config();
@ -82,7 +82,7 @@ int test_fd_init(void)
ret = ogs_diam_start();
ogs_assert(ret == 0);
return 0;
return 0;
}
void test_fd_final(void)