Mercurial > hg > freeDiameter
comparison extensions/rt_redirect/rt_redir.h @ 1259:82280e745a89
Remove whitespace at end of line.
author | Thomas Klausner <tk@giga.or.at> |
---|---|
date | Mon, 24 Mar 2014 13:13:38 +0100 |
parents | f937feb72734 |
children | 4f6f61e67599 |
comparison
equal
deleted
inserted
replaced
1258:97caad40b665 | 1259:82280e745a89 |
---|---|
36 /* Diameter Redirect management */ | 36 /* Diameter Redirect management */ |
37 #include <freeDiameter/extension.h> | 37 #include <freeDiameter/extension.h> |
38 | 38 |
39 /* There are 2 locks in this module. The priority is established as follow to avoid deadlocks: | 39 /* There are 2 locks in this module. The priority is established as follow to avoid deadlocks: |
40 exp_peer mutex > usages rwlock. | 40 exp_peer mutex > usages rwlock. |
41 (e.g., the rwlock can be taken while holding the mutex, but not the other way) | 41 (e.g., the rwlock can be taken while holding the mutex, but not the other way) |
42 */ | 42 */ |
43 | 43 |
44 /* The types of redirects (from Redirect-Host-Usage AVP value) */ | 44 /* The types of redirects (from Redirect-Host-Usage AVP value) */ |
45 enum redir_h_u { | 45 enum redir_h_u { |
46 DONT_CACHE = 0, | 46 DONT_CACHE = 0, |
56 /* Eye catcher */ | 56 /* Eye catcher */ |
57 #define REDIR_ENTRY_EYEC 0x43D14E74 | 57 #define REDIR_ENTRY_EYEC 0x43D14E74 |
58 | 58 |
59 /* Expiration time set for DONT_CACHE tasks, so that the entry is found when the code is called back */ | 59 /* Expiration time set for DONT_CACHE tasks, so that the entry is found when the code is called back */ |
60 #define DEFAULT_EXPIRE_TIME 10 /* seconds */ | 60 #define DEFAULT_EXPIRE_TIME 10 /* seconds */ |
61 | 61 |
62 /* Structure to store a parsed Redirect-Host */ | 62 /* Structure to store a parsed Redirect-Host */ |
63 struct redir_host { | 63 struct redir_host { |
64 struct fd_list chain; | 64 struct fd_list chain; |
65 | 65 |
66 DiamId_t id; /* malloc'd */ | 66 DiamId_t id; /* malloc'd */ |
67 size_t len; | 67 size_t len; |
68 /* We don't use the following yet because we don't support dynamic new connections | 68 /* We don't use the following yet because we don't support dynamic new connections |
69 int secure; | 69 int secure; |
70 uint16_t port; | 70 uint16_t port; |
71 int l4; | 71 int l4; |
72 char proto; | 72 char proto; |
73 */ | 73 */ |
114 struct { | 114 struct { |
115 os0_t s; /* User-Name AVP data */ | 115 os0_t s; /* User-Name AVP data */ |
116 size_t l; | 116 size_t l; |
117 } user; | 117 } user; |
118 }; | 118 }; |
119 | 119 |
120 | 120 |
121 /* Structure to store a Redirect indication */ | 121 /* Structure to store a Redirect indication */ |
122 struct redir_entry { | 122 struct redir_entry { |
123 uint32_t eyec; /* must be REDIR_ENTRY_EYEC, used for debug only */ | 123 uint32_t eyec; /* must be REDIR_ENTRY_EYEC, used for debug only */ |
124 | 124 |
125 struct { | 125 struct { |
126 os0_t s; /* alloc'd, must be freed */ | 126 os0_t s; /* alloc'd, must be freed */ |
127 size_t l; | 127 size_t l; |
128 } from; /* whom this rule was received from (next hop) ? */ | 128 } from; /* whom this rule was received from (next hop) ? */ |
129 | 129 |
130 struct fd_list target_peers_list; /* The list of Redirect-Hosts for this entry */ | 130 struct fd_list target_peers_list; /* The list of Redirect-Hosts for this entry */ |
131 | 131 |
132 struct timespec timeout; /* When does this entry expires? */ | 132 struct timespec timeout; /* When does this entry expires? */ |
133 struct fd_list exp_list; /* chain in the expire_list list, ordered by expiration date, protected by exp_peer_lock */ | 133 struct fd_list exp_list; /* chain in the expire_list list, ordered by expiration date, protected by exp_peer_lock */ |
134 | 134 |
135 enum redir_h_u type; /* Type of this entry */ | 135 enum redir_h_u type; /* Type of this entry */ |
136 struct fd_list redir_list; /* link in redirects_usages lists. Lists are ordered by the data value. Protected by rw locks */ | 136 struct fd_list redir_list; /* link in redirects_usages lists. Lists are ordered by the data value. Protected by rw locks */ |
137 union matchdata data; /* The strings are duplicated & must be freed in this structure */ | 137 union matchdata data; /* The strings are duplicated & must be freed in this structure */ |
138 }; | 138 }; |
139 | 139 |