annotate freeDiameter/fD.h @ 258:5df55136361b

Updated copyright information
author Sebastien Decugis <sdecugis@nict.go.jp>
date Fri, 16 Apr 2010 17:04:15 +0900
parents 965f5971dc23
children 0daf6fc2b751
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
1 /*********************************************************************************************************
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
2 * Software License Agreement (BSD License) *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
3 * Author: Sebastien Decugis <sdecugis@nict.go.jp> *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
4 * *
258
5df55136361b Updated copyright information
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 229
diff changeset
5 * Copyright (c) 2010, WIDE Project and NICT *
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
6 * All rights reserved. *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
7 * *
13530e1f02e3 Initial files imported
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 *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
9 * permitted provided that the following conditions are met: *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
10 * *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
11 * * Redistributions of source code must retain the above *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
12 * copyright notice, this list of conditions and the *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
13 * following disclaimer. *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
14 * *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
15 * * Redistributions in binary form must reproduce the above *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
16 * copyright notice, this list of conditions and the *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
17 * following disclaimer in the documentation and/or other *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
18 * materials provided with the distribution. *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
19 * *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
20 * * Neither the name of the WIDE Project or NICT nor the *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
21 * names of its contributors may be used to endorse or *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
22 * promote products derived from this software without *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
23 * specific prior written permission of WIDE Project and *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
24 * NICT. *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
25 * *
13530e1f02e3 Initial files imported
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 *
13530e1f02e3 Initial files imported
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 *
13530e1f02e3 Initial files imported
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 *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
29 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
13530e1f02e3 Initial files imported
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 *
13530e1f02e3 Initial files imported
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 *
13530e1f02e3 Initial files imported
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 *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
33 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
34 *********************************************************************************************************/
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
35
1
bafb831ba688 Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
36 /* This file contains the definitions for internal use in the freeDiameter daemon */
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
37
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
38 #ifndef _FD_H
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
39 #define _FD_H
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
40
1
bafb831ba688 Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
41 #include <freeDiameter/freeDiameter-host.h>
bafb831ba688 Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
42 #include <freeDiameter/freeDiameter.h>
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
43
33
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
44 #ifdef DISABLE_SCTP
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
45 #undef IPPROTO_SCTP
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
46 #define IPPROTO_SCTP (2 = 4) /* some compilation error to spot the references */
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
47 #endif /* DISABLE_SCTP */
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
48
14
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
49 /* Timeout for establishing a connection */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
50 #ifndef CNX_TIMEOUT
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
51 #define CNX_TIMEOUT 10 /* in seconds */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
52 #endif /* CNX_TIMEOUT */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
53
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
54 /* Timeout for receiving a CER after incoming connection is established */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
55 #ifndef INCNX_TIMEOUT
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
56 #define INCNX_TIMEOUT 20 /* in seconds */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
57 #endif /* INCNX_TIMEOUT */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
58
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
59 /* Timeout for receiving a CEA after CER is sent */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
60 #ifndef CEA_TIMEOUT
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
61 #define CEA_TIMEOUT 10 /* in seconds */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
62 #endif /* CEA_TIMEOUT */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
63
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
64 /* The timeout value to wait for answer to a DPR */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
65 #ifndef DPR_TIMEOUT
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
66 #define DPR_TIMEOUT 15 /* in seconds */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
67 #endif /* DPR_TIMEOUT */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
68
43
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
69 /* The Vendor-Id to advertise in CER/CEA */
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
70 #ifndef MY_VENDOR_ID
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
71 #define MY_VENDOR_ID 0 /* Reserved value to tell it must be ignored */
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
72 #endif /* MY_VENDOR_ID */
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
73
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
74
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
75
8
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
76 /* Configuration */
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
77 int fd_conf_init();
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
78 void fd_conf_dump();
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
79 int fd_conf_parse();
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
80 int fddparse(struct fd_config * conf); /* yacc generated */
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
81
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
82 /* Extensions */
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
83 int fd_ext_add( char * filename, char * conffile );
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
84 int fd_ext_load();
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
85 void fd_ext_dump(void);
8
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
86 int fd_ext_fini(void);
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
87
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
88 /* Messages */
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
89 int fd_msg_init(void);
66
dcbd5b5ee55c Added handling for DWR/DWA
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 43
diff changeset
90 struct dict_object * fd_dict_avp_OSI; /* Origin-State-Id */
dcbd5b5ee55c Added handling for DWR/DWA
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 43
diff changeset
91 struct dict_object * fd_dict_cmd_CER; /* Capabilities-Exchange-Request */
dcbd5b5ee55c Added handling for DWR/DWA
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 43
diff changeset
92 struct dict_object * fd_dict_cmd_DWR; /* Device-Watchdog-Request */
78
a58f0757c06a Added code for DPR/DPA
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 70
diff changeset
93 struct dict_object * fd_dict_avp_DC; /* Disconnect-Cause */
66
dcbd5b5ee55c Added handling for DWR/DWA
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 43
diff changeset
94 struct dict_object * fd_dict_cmd_DPR; /* Disconnect-Peer-Request */
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
95
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
96 /* Global message queues */
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
97 extern struct fifo * fd_g_incoming; /* all messages received from other peers, except local messages (CER, ...) */
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
98 extern struct fifo * fd_g_outgoing; /* messages to be sent to other peers on the network following routing procedure */
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
99 extern struct fifo * fd_g_local; /* messages to be handled to local extensions */
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
100 /* Message queues */
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
101 int fd_queues_init(void);
124
cc42d8607114 Completed cleanups of queues when the daemon is stopping
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 123
diff changeset
102 int fd_queues_fini(struct fifo ** queue);
10
c5c99c73c2bf Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
103
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
104 /* Create all the dictionary objects defined in the Diameter base RFC. */
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
105 int fd_dict_base_protocol(struct dictionary * dict);
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
106
82
b6344f1d521a Some cleanups
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 78
diff changeset
107 /* Routing */
123
960fa8048805 Merged routing and dispatch files for similarities
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 122
diff changeset
108 int fd_rtdisp_init(void);
960fa8048805 Merged routing and dispatch files for similarities
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 122
diff changeset
109 int fd_rtdisp_cleanstop(void);
960fa8048805 Merged routing and dispatch files for similarities
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 122
diff changeset
110 int fd_rtdisp_fini(void);
960fa8048805 Merged routing and dispatch files for similarities
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 122
diff changeset
111 int fd_rtdisp_cleanup(void);
82
b6344f1d521a Some cleanups
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 78
diff changeset
112
34
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
113 /* Sentinel for the sent requests list */
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
114 struct sr_list {
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
115 struct fd_list srs;
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
116 pthread_mutex_t mtx;
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
117 };
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
118
11
6576ef5e01eb Added some support for peers
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
119 /* Peers */
6576ef5e01eb Added some support for peers
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
120 struct fd_peer { /* The "real" definition of the peer structure */
6576ef5e01eb Added some support for peers
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
121
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
122 /* The public data */
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
123 struct peer_hdr p_hdr;
11
6576ef5e01eb Added some support for peers
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
124
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
125 /* Eye catcher, EYEC_PEER */
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
126 int p_eyec;
11
6576ef5e01eb Added some support for peers
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
127 #define EYEC_PEER 0x373C9336
6576ef5e01eb Added some support for peers
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
128
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
129 /* Origin of this peer object, for debug */
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
130 char *p_dbgorig;
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
131
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
132 /* Chaining in peers sublists */
33
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
133 struct fd_list p_actives; /* list of peers in the STATE_OPEN state -- used by routing */
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
134 struct fd_list p_expiry; /* list of expiring peers, ordered by their timeout value */
14
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
135 struct timespec p_exp_timer; /* Timestamp where the peer will expire; updated each time activity is seen on the peer (except DW) */
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
136
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
137 /* Some flags influencing the peer state machine */
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
138 struct {
37
cc3c59fe98fe Lot of cleanups in peer structure management
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 36
diff changeset
139 unsigned pf_responder : 1; /* The peer has been created to handle incoming connection */
154
4356de61174d Small tweaks in the PSM
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 124
diff changeset
140 unsigned pf_delete : 1; /* Destroy the peer when the connection is terminated */
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
141
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
142 unsigned pf_dw_pending : 1; /* A DWR message was sent and not answered yet */
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
143
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
144 unsigned pf_cnx_pb : 1; /* The peer was disconnected because of watchdogs; must exchange 3 watchdogs before putting back to normal */
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
145 unsigned pf_reopen_cnt : 2; /* remaining DW to be exchanged after re-established connection */
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
146
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
147 } p_flags;
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
148
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
149 /* The events queue, peer state machine thread, timer for states timeouts */
14
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
150 struct fifo *p_events; /* The mutex of this FIFO list protects also the state and timer information */
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
151 pthread_t p_psm;
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
152 struct timespec p_psm_timer;
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
153
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
154 /* Outgoing message queue, and thread managing sending the messages */
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
155 struct fifo *p_tosend;
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
156 pthread_t p_outthr;
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
157
14
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
158 /* The next hop-by-hop id value for the link, only read & modified by p_outthr */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
159 uint32_t p_hbh;
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
160
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
161 /* Sent requests (for fallback), list of struct sentreq ordered by hbh */
34
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
162 struct sr_list p_sr;
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
163
37
cc3c59fe98fe Lot of cleanups in peer structure management
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 36
diff changeset
164 /* Data for transitional states before the peer is in OPEN state */
cc3c59fe98fe Lot of cleanups in peer structure management
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 36
diff changeset
165 struct {
cc3c59fe98fe Lot of cleanups in peer structure management
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 36
diff changeset
166 struct cnxctx * p_receiver; /* Only used in case of election */
43
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
167 struct msg * p_cer; /* Only used in case of election */
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
168
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
169 pthread_t p_ini_thr; /* Initiator thread for establishing a connection */
38
68c1890f7049 Fixed a small bug in SCTP close
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 37
diff changeset
170 struct fd_list p_connparams; /* The list of connection attempts, see p_cnx.c */
37
cc3c59fe98fe Lot of cleanups in peer structure management
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 36
diff changeset
171 };
cc3c59fe98fe Lot of cleanups in peer structure management
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 36
diff changeset
172
33
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
173 /* connection context: socket and related information */
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
174 struct cnxctx *p_cnxctx;
11
6576ef5e01eb Added some support for peers
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
175
33
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
176 /* Callback for peer validation after the handshake */
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
177 int (*p_cb2)(struct peer_info *);
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
178
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
179 /* Callback on initial connection success / failure after the peer was added */
13
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 12
diff changeset
180 void (*p_cb)(struct peer_info *, void *);
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 12
diff changeset
181 void *p_cb_data;
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 12
diff changeset
182
11
6576ef5e01eb Added some support for peers
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
183 };
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
184 #define CHECK_PEER( _p ) \
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
185 (((_p) != NULL) && (((struct fd_peer *)(_p))->p_eyec == EYEC_PEER))
11
6576ef5e01eb Added some support for peers
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
186
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
187 /* Events codespace for struct fd_peer->p_events */
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
188 enum {
16
013ce9851131 Started including TLS code
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 14
diff changeset
189 /* Dump all info about this peer in the debug log */
25
67ca08d5bc48 Completed connection context files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
190 FDEVP_DUMP_ALL = 1500
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
191
16
013ce9851131 Started including TLS code
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 14
diff changeset
192 /* request to terminate this peer : disconnect, requeue all messages */
013ce9851131 Started including TLS code
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 14
diff changeset
193 ,FDEVP_TERMINATE
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
194
28
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
195 /* A connection object has received a message. (data contains the buffer) */
22
0b3b46da2c12 Progress on server code
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 21
diff changeset
196 ,FDEVP_CNX_MSG_RECV
25
67ca08d5bc48 Completed connection context files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
197
67ca08d5bc48 Completed connection context files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
198 /* A connection object has encountered an error (disconnected). */
67ca08d5bc48 Completed connection context files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
199 ,FDEVP_CNX_ERROR
67ca08d5bc48 Completed connection context files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
200
67ca08d5bc48 Completed connection context files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
201 /* Endpoints of a connection have been changed (multihomed SCTP). */
67ca08d5bc48 Completed connection context files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
202 ,FDEVP_CNX_EP_CHANGE
22
0b3b46da2c12 Progress on server code
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 21
diff changeset
203
228
dcb58243e91f More cleanups
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 208
diff changeset
204 /* The connection is being shutdown (SCTP notification). */
dcb58243e91f More cleanups
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 208
diff changeset
205 ,FDEVP_CNX_SHUTDOWN
dcb58243e91f More cleanups
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 208
diff changeset
206
37
cc3c59fe98fe Lot of cleanups in peer structure management
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 36
diff changeset
207 /* A new connection (with a CER) has been received */
28
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
208 ,FDEVP_CNX_INCOMING
14
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
209
37
cc3c59fe98fe Lot of cleanups in peer structure management
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 36
diff changeset
210 /* A new connection has been established to the remote peer (event data is the cnxctx object) */
cc3c59fe98fe Lot of cleanups in peer structure management
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 36
diff changeset
211 ,FDEVP_CNX_ESTABLISHED
cc3c59fe98fe Lot of cleanups in peer structure management
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 36
diff changeset
212
70
65b32c93f21e Do not wait for timeout when all connections attempts have failed
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 66
diff changeset
213 /* A connection attempt (initiator side) has failed */
65b32c93f21e Do not wait for timeout when all connections attempts have failed
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 66
diff changeset
214 ,FDEVP_CNX_FAILED
65b32c93f21e Do not wait for timeout when all connections attempts have failed
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 66
diff changeset
215
14
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
216 /* The PSM state is expired */
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
217 ,FDEVP_PSM_TIMEOUT
22
0b3b46da2c12 Progress on server code
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 21
diff changeset
218
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
219 };
33
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
220 #define CHECK_PEVENT( _e ) \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
221 (((int)(_e) >= FDEVP_DUMP_ALL) && ((int)(_e) <= FDEVP_PSM_TIMEOUT))
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
222 /* The following macro is actually called in p_psm.c -- another solution would be to declare it static inline */
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
223 #define DECLARE_PEV_STR() \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
224 const char * fd_pev_str(int event) \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
225 { \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
226 switch (event) { \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
227 case_str(FDEVP_DUMP_ALL); \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
228 case_str(FDEVP_TERMINATE); \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
229 case_str(FDEVP_CNX_MSG_RECV); \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
230 case_str(FDEVP_CNX_ERROR); \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
231 case_str(FDEVP_CNX_EP_CHANGE); \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
232 case_str(FDEVP_CNX_INCOMING); \
37
cc3c59fe98fe Lot of cleanups in peer structure management
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 36
diff changeset
233 case_str(FDEVP_CNX_ESTABLISHED); \
70
65b32c93f21e Do not wait for timeout when all connections attempts have failed
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 66
diff changeset
234 case_str(FDEVP_CNX_FAILED); \
33
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
235 case_str(FDEVP_PSM_TIMEOUT); \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
236 } \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
237 TRACE_DEBUG(FULL, "Unknown event : %d", event); \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
238 return "Unknown event"; \
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
239 }
14
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
240 const char * fd_pev_str(int event);
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
241
229
965f5971dc23 Broadcast CEA over all streams to avoid possible race condition
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 228
diff changeset
242 /* The data structure for FDEVP_CNX_INCOMING event */
29
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
243 struct cnx_incoming {
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
244 struct msg * cer; /* the CER message received on this connection */
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
245 struct cnxctx * cnx; /* The connection context */
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
246 int validate; /* The peer is new, it must be validated (by an extension) or error CEA to be sent */
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
247 };
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
248
20
277ec00d793e Backup before typhoon... Progress on server side
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 16
diff changeset
249
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
250 /* Functions */
28
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
251 int fd_peer_fini();
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
252 void fd_peer_dump_list(int details);
16
013ce9851131 Started including TLS code
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 14
diff changeset
253 void fd_peer_dump(struct fd_peer * peer, int details);
28
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
254 int fd_peer_alloc(struct fd_peer ** ptr);
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
255 int fd_peer_free(struct fd_peer ** ptr);
29
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
256 int fd_peer_handle_newCER( struct msg ** cer, struct cnxctx ** cnx );
13
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 12
diff changeset
257 /* fd_peer_add declared in freeDiameter.h */
29
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
258 int fd_peer_validate( struct fd_peer * peer );
34
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
259 void fd_peer_failover_msg(struct fd_peer * peer);
11
6576ef5e01eb Added some support for peers
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
260
13
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 12
diff changeset
261 /* Peer expiry */
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 12
diff changeset
262 int fd_p_expi_init(void);
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 12
diff changeset
263 int fd_p_expi_fini(void);
14
14cf6daf716d Some progress on peers module
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
264 int fd_p_expi_update(struct fd_peer * peer );
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
265
13
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 12
diff changeset
266 /* Peer state machine */
28
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
267 int fd_psm_start();
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
268 int fd_psm_begin(struct fd_peer * peer );
78
a58f0757c06a Added code for DPR/DPA
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 70
diff changeset
269 int fd_psm_terminate(struct fd_peer * peer, char * reason );
13
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 12
diff changeset
270 void fd_psm_abord(struct fd_peer * peer );
36
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 35
diff changeset
271 void fd_psm_next_timeout(struct fd_peer * peer, int add_random, int delay);
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 35
diff changeset
272 int fd_psm_change_state(struct fd_peer * peer, int new_state);
38
68c1890f7049 Fixed a small bug in SCTP close
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 37
diff changeset
273 void fd_psm_cleanup(struct fd_peer * peer, int terminate);
12
418d2ce80dc8 Added support in configuration file for peers declaration
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 11
diff changeset
274
33
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
275 /* Peer out */
229
965f5971dc23 Broadcast CEA over all streams to avoid possible race condition
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 228
diff changeset
276 int fd_out_send(struct msg ** msg, struct cnxctx * cnx, struct fd_peer * peer, uint32_t flags);
33
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
277 int fd_out_start(struct fd_peer * peer);
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
278 int fd_out_stop(struct fd_peer * peer);
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
279
38
68c1890f7049 Fixed a small bug in SCTP close
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 37
diff changeset
280 /* Initiating connections */
68c1890f7049 Fixed a small bug in SCTP close
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 37
diff changeset
281 int fd_p_cnx_init(struct fd_peer * peer);
68c1890f7049 Fixed a small bug in SCTP close
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 37
diff changeset
282 void fd_p_cnx_abort(struct fd_peer * peer, int cleanup_all);
68c1890f7049 Fixed a small bug in SCTP close
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 37
diff changeset
283
34
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
284 /* Peer sent requests cache */
165
4679ff581d6a Fix invalid restore of the hop-by-hop id on forwarded answers
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 154
diff changeset
285 int fd_p_sr_store(struct sr_list * srlist, struct msg **req, uint32_t *hbhloc, uint32_t hbh_restore);
34
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
286 int fd_p_sr_fetch(struct sr_list * srlist, uint32_t hbh, struct msg **req);
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
287 void fd_p_sr_failover(struct sr_list * srlist);
0e2b57789361 Backup for the WE, some warnings remaining
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 33
diff changeset
288
36
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 35
diff changeset
289 /* Local Link messages (CER/CEA, DWR/DWA, DPR/DPA) */
40
7e1deaa89540 Some progress on the PSM
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 38
diff changeset
290 int fd_p_ce_msgrcv(struct msg ** msg, int req, struct fd_peer * peer);
36
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 35
diff changeset
291 int fd_p_ce_handle_newCER(struct msg ** msg, struct fd_peer * peer, struct cnxctx ** cnx, int valid);
40
7e1deaa89540 Some progress on the PSM
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 38
diff changeset
292 int fd_p_ce_handle_newcnx(struct fd_peer * peer, struct cnxctx * initiator);
43
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
293 int fd_p_ce_process_receiver(struct fd_peer * peer);
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
294 void fd_p_ce_clear_cnx(struct fd_peer * peer, struct cnxctx ** cnx_kept);
40
7e1deaa89540 Some progress on the PSM
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 38
diff changeset
295 int fd_p_dw_handle(struct msg ** msg, int req, struct fd_peer * peer);
36
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 35
diff changeset
296 int fd_p_dw_timeout(struct fd_peer * peer);
43
2db15632a63d Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 40
diff changeset
297 int fd_p_dw_reopen(struct fd_peer * peer);
40
7e1deaa89540 Some progress on the PSM
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 38
diff changeset
298 int fd_p_dp_handle(struct msg ** msg, int req, struct fd_peer * peer);
78
a58f0757c06a Added code for DPR/DPA
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 70
diff changeset
299 int fd_p_dp_initiate(struct fd_peer * peer, char * reason);
35
6486e97f56ae Added test for modified message parsing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 34
diff changeset
300
33
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
301 /* Active peers -- routing process should only ever take the read lock, the write lock is managed by PSMs */
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
302 extern struct fd_list fd_g_activ_peers;
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
303 extern pthread_rwlock_t fd_g_activ_peers_rw; /* protect the list */
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
304
e6fcdf12b9a0 Added a lot of TODOs :)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 31
diff changeset
305
20
277ec00d793e Backup before typhoon... Progress on server side
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 16
diff changeset
306 /* Server sockets */
277ec00d793e Backup before typhoon... Progress on server side
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 16
diff changeset
307 void fd_servers_dump();
28
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
308 int fd_servers_start();
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
309 int fd_servers_stop();
20
277ec00d793e Backup before typhoon... Progress on server side
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 16
diff changeset
310
28
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
311 /* Connection contexts -- there are also definitions in cnxctx.h for the relevant files */
22
0b3b46da2c12 Progress on server code
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 21
diff changeset
312 struct cnxctx * fd_cnx_serv_tcp(uint16_t port, int family, struct fd_endpoint * ep);
0b3b46da2c12 Progress on server code
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 21
diff changeset
313 struct cnxctx * fd_cnx_serv_sctp(uint16_t port, struct fd_list * ep_list);
28
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
314 int fd_cnx_serv_listen(struct cnxctx * conn);
22
0b3b46da2c12 Progress on server code
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 21
diff changeset
315 struct cnxctx * fd_cnx_serv_accept(struct cnxctx * serv);
24
bd83ce9328ed Cleanups and completed sctp code (not finished)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 23
diff changeset
316 struct cnxctx * fd_cnx_cli_connect_tcp(sSA * sa, socklen_t addrlen);
bd83ce9328ed Cleanups and completed sctp code (not finished)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 23
diff changeset
317 struct cnxctx * fd_cnx_cli_connect_sctp(int no_ip6, uint16_t port, struct fd_list * list);
29
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
318 int fd_cnx_start_clear(struct cnxctx * conn, int loop);
31
26685c67d387 Completed the test and fixed a couple issues
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
319 void fd_cnx_sethostname(struct cnxctx * conn, char * hn);
29
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
320 int fd_cnx_handshake(struct cnxctx * conn, int mode, char * priority, void * alt_creds);
28
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
321 char * fd_cnx_getid(struct cnxctx * conn);
29
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
322 int fd_cnx_getproto(struct cnxctx * conn);
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 28
diff changeset
323 int fd_cnx_getTLS(struct cnxctx * conn);
28
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
324 int fd_cnx_getcred(struct cnxctx * conn, const gnutls_datum_t **cert_list, unsigned int *cert_list_size);
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
325 int fd_cnx_getendpoints(struct cnxctx * conn, struct fd_list * local, struct fd_list * remote);
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
326 char * fd_cnx_getremoteid(struct cnxctx * conn);
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
327 int fd_cnx_receive(struct cnxctx * conn, struct timespec * timeout, unsigned char **buf, size_t * len);
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
328 int fd_cnx_recv_setaltfifo(struct cnxctx * conn, struct fifo * alt_fifo); /* send FDEVP_CNX_MSG_RECV event to the fifo list */
229
965f5971dc23 Broadcast CEA over all streams to avoid possible race condition
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 228
diff changeset
329 int fd_cnx_send(struct cnxctx * conn, unsigned char * buf, size_t len, uint32_t flags);
28
3628f7d2ba88 some new functions backbones
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 25
diff changeset
330 void fd_cnx_destroy(struct cnxctx * conn);
20
277ec00d793e Backup before typhoon... Progress on server side
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 16
diff changeset
331
229
965f5971dc23 Broadcast CEA over all streams to avoid possible race condition
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 228
diff changeset
332 /* Flags for the fd_cnx_send function : */
965f5971dc23 Broadcast CEA over all streams to avoid possible race condition
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 228
diff changeset
333 #define FD_CNX_ORDERED (1 << 0) /* All messages sent with this flag set will be delivered in the same order. No guarantee on other messages */
965f5971dc23 Broadcast CEA over all streams to avoid possible race condition
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 228
diff changeset
334 #define FD_CNX_BROADCAST (1 << 1) /* The message is sent over all stream pairs, in case of SCTP. No effect on TCP */
20
277ec00d793e Backup before typhoon... Progress on server side
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 16
diff changeset
335
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
336 #endif /* _FD_H */
"Welcome to our mercurial repository"