annotate libfdcore/queues.c @ 1513:73e563165594

Add 3GPP TS 29.468 V15.8.0 (2019-12) Add AVPs: - BMSC-Address, Address, code 3500, section 6.4.2 - BMSC-Port, Unsigned32, code 3501, section 6.4.3 - Common-Tunnel-Endpoint-Identifier, OctetString, code 3524, section 6.4.26 - FEC-Request, OctetString, code 3525, section 6.4.27 - FEC-Result, Unsigned32, code 3531, section 6.4.33 - Local-M1-Information, Grouped, code 3518, section 6.4.20 - Local-MB2-U-Information, Grouped, code 3519, section 6.4.21 - MB2U-Security, Unsigned32, code 3517, section 6.4.19 - MBMS-Bearer-Event, Unsigned32, code 3502, section 6.4.4 - MBMS-Bearer-Event-Notification, Grouped, code 3503, section 6.4.5 - MBMS-Bearer-Request, Grouped, code 3504, section 6.4.6 - MBMS-Bearer-Response, Grouped, code 3505, section 6.4.7 - MBMS-Bearer-Result, Unsigned32, code 3506, section 6.4.8 - MBMS-eNB-IP-Multicast-Address, Address, code 3520, section 6.4.22 - MBMS-eNB-IPv6-Multicast-Address, Address, code 3521, section 6.4.23 - MBMS-GW-SSM-IP-Address-29.468, Address, code 3522, section 6.4.24 - MBMS-GW-SSM-IPv6-Address-29.468, Address, code 3523, section 6.4.25 - MBMS-Start-Time, Time, code 3507, section 6.4.9 - Radio-Frequency-29.468, Unsigned32, code 3508, section 6.4.10 - ROHC-Full-Header-Periodicity, Float32, code 3527, section 6.4.29 - ROHC-Max-CID, Unsigned32, code 3532, section 6.4.34 - ROHC-Profile, Unsigned32, code 3528, section 6.4.30 - ROHC-Request, Grouped, code 3526, section 6.4.28 - ROHC-Result, Unsigned32, code 3530, section 6.4.32 - TMGI-Allocation-Request, Grouped, code 3509, section 6.4.11 - TMGI-Allocation-Response, Grouped, code 3510, section 6.4.12 - TMGI-Allocation-Result, Unsigned32, code 3511, section 6.4.13 - TMGI-Deallocation-Request, Grouped, code 3512, section 6.4.14 - TMGI-Deallocation-Response, Grouped, code 3513, section 6.4.15 - TMGI-Deallocation-Result, Unsigned32, code 3514, section 6.4.16 - TMGI-Expiry, Grouped, code 3515, section 6.4.17 - TMGI-Number, Unsigned32, code 3516, section 6.4.18 - Userplane-Protocol-Result, Grouped, code 3529, section 6.4.31 Note: Name conflict with 3GPP TS 29.061 MBMS-GW-SSM-IP-Address (924). 3GPP TS 29.061 V10.4.0 (2011-09) CR 0355 added MBMS-GW-SSM-IP-Address (924). 3GPP TS 29.468 V14.0.0 (2016-12) CR 0021 added MBMS-GW-SSM-IP-Address (3522). Fix: MBMS-GW-SSM-IP-Address (3522) renamed to MBMS-GW-SSM-IP-Address-29.468 (3522). Note: Name conflict with 3GPP TS 29.061 MBMS-GW-SSM-IPv6-Address (925). 3GPP TS 29.061 V10.4.0 (2011-09) CR 0355 added MBMS-GW-SSM-IPv6-Address (925). 3GPP TS 29.468 V14.0.0 (2016-12) CR 0021 added MBMS-GW-SSM-IPv6-Address (3523). Fix: MBMS-GW-SSM-IPv6-Address (3523) renamed to MBMS-GW-SSM-IPv6-Address-29.468 (3523). Note: Name conflict with 3GPP TS 32.299 Radio-Frequency (3462). 3GPP TS 29.468 V12.0.0 (2014-09) added Radio-Frequency (3508). 3GPP TS 32.299 V13.1.0 (2015-06) CR 0638 added Radio-Frequency (3462). Fix: Radio-Frequency (3508) renamed to Radio-Frequency-29.468 (3508).
author Luke Mewburn <luke@mewburn.net>
date Tue, 07 Apr 2020 19:38:33 +1000
parents 239ba25870d8
children 566bb46cc73f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
1 /*********************************************************************************************************
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
2 * Software License Agreement (BSD License) *
740
4a9f08d6b6ba Updated my mail address
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 688
diff changeset
3 * Author: Sebastien Decugis <sdecugis@freediameter.net> *
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
4 * *
1127
1af09cc156d6 Updated copyright information
Sebastien Decugis <sdecugis@freediameter.net>
parents: 1113
diff changeset
5 * Copyright (c) 2013, WIDE Project and NICT *
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
6 * All rights reserved. *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
7 * *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
8 * Redistribution and use of this software in source and binary forms, with or without modification, are *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
9 * permitted provided that the following conditions are met: *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
10 * *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
11 * * Redistributions of source code must retain the above *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
12 * copyright notice, this list of conditions and the *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
13 * following disclaimer. *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
14 * *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
15 * * Redistributions in binary form must reproduce the above *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
16 * copyright notice, this list of conditions and the *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
17 * following disclaimer in the documentation and/or other *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
18 * materials provided with the distribution. *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
19 * *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
20 * * Neither the name of the WIDE Project or NICT nor the *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
21 * names of its contributors may be used to endorse or *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
22 * promote products derived from this software without *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
23 * specific prior written permission of WIDE Project and *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
24 * NICT. *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
25 * *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
27 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
28 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
29 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
32 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
33 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
34 *********************************************************************************************************/
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
35
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 124
diff changeset
36 #include "fdcore-internal.h"
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
37
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
38 /* The global message queues */
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
39 struct fifo * fd_g_incoming = NULL;
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
40 struct fifo * fd_g_outgoing = NULL;
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
41 struct fifo * fd_g_local = NULL;
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
42
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
43 /* Initialize the message queues. */
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
44 int fd_queues_init(void)
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
45 {
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
46 TRACE_ENTRY();
1397
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
47 CHECK_FCT( fd_fifo_new ( &fd_g_incoming, fd_g_config->cnf_qin_limit ) );
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
48 CHECK_FCT( fd_fifo_new ( &fd_g_outgoing, fd_g_config->cnf_qout_limit ) );
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
49 CHECK_FCT( fd_fifo_new ( &fd_g_local, fd_g_config->cnf_qlocal_limit ) );
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
50 return 0;
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
51 }
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
52
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
53 /* Resize according to values given in configuration file */
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
54 int fd_queues_init_after_conf(void)
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
55 {
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
56 TRACE_ENTRY();
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
57 CHECK_FCT( fd_fifo_set_max ( fd_g_incoming, fd_g_config->cnf_qin_limit ) );
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
58 CHECK_FCT( fd_fifo_set_max ( fd_g_outgoing, fd_g_config->cnf_qout_limit ) );
239ba25870d8 Allow parametrizing the number of threads for routing in/out.
Thomas Klausner <tk@giga.or.at>
parents: 1127
diff changeset
59 CHECK_FCT( fd_fifo_set_max ( fd_g_local, fd_g_config->cnf_qlocal_limit ) );
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
60 return 0;
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
61 }
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
62
124
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
63 /* Destroy a queue after emptying it (and dumping the content) */
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
64 int fd_queues_fini(struct fifo ** queue)
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
65 {
124
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
66 struct msg * msg;
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
67 int ret = 0;
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
68
124
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
69 TRACE_ENTRY("%p", queue);
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
70
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
71 /* Note : the threads that post into this queue should already been stopped before this !!! */
686
f83d9878bf66 Fixed in case of termination of several modules (before initialization completed)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
72
f83d9878bf66 Fixed in case of termination of several modules (before initialization completed)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
73 CHECK_PARAMS(queue);
f83d9878bf66 Fixed in case of termination of several modules (before initialization completed)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
74 if (*queue == NULL)
f83d9878bf66 Fixed in case of termination of several modules (before initialization completed)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
75 return 0; /* the queue was not already initialized */
124
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
76
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
77 /* Empty all contents */
124
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
78 while (1) {
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
79 /* Check if there is a message in the queue */
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
80 ret = fd_fifo_tryget(*queue, &msg);
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
81 if (ret == EWOULDBLOCK)
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
82 break;
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
83 CHECK_FCT(ret);
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
84
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
85 /* We got one! */
1113
eb4ce68b6e5c Added calls to remaining hooks
Sebastien Decugis <sdecugis@freediameter.net>
parents: 1078
diff changeset
86 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, NULL, "Message lost because framework is terminating.", fd_msg_pmdl_get(msg));
124
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
87 fd_msg_free(msg);
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
88 }
13
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
89
124
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
90 /* Now, delete the empty queue */
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
91 CHECK_FCT( fd_fifo_del ( queue ) );
123
960fa8048805 Merged routing and dispatch files for similarities
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
92
960fa8048805 Merged routing and dispatch files for similarities
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
93 return 0;
960fa8048805 Merged routing and dispatch files for similarities
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
94 }
"Welcome to our mercurial repository"