Changeset 1194:90d1222a65a8 in freeDiameter
- Timestamp:
- Jun 11, 2013, 3:04:40 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/freeDiameter/libfdcore.h
r1190 r1194 1047 1047 */ 1048 1048 1049 #define HOOK_ PEER_LAST HOOK_PEER_CONNECT_SUCCESS1049 #define HOOK_LAST HOOK_PEER_CONNECT_SUCCESS 1050 1050 }; 1051 1051 -
libfdcore/hooks.c
r1186 r1194 56 56 /* Now a hook registered by an extension */ 57 57 struct fd_hook_hdl { 58 struct fd_list chain[HOOK_ PEER_LAST+1];58 struct fd_list chain[HOOK_LAST+1]; 59 59 void (*fd_hook_cb)(enum fd_hook_type type, struct msg * msg, struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd, void * regdata); 60 60 void *regdata; … … 66 66 struct fd_list sentinel; 67 67 pthread_rwlock_t rwlock; 68 } HS_array[HOOK_ PEER_LAST+1];68 } HS_array[HOOK_LAST+1]; 69 69 70 70 /* Initialize the array of sentinels for the hooks */ … … 72 72 { 73 73 int i; 74 for (i=0; i <= HOOK_ PEER_LAST; i++) {74 for (i=0; i <= HOOK_LAST; i++) { 75 75 fd_list_init(&HS_array[i].sentinel, NULL); 76 76 CHECK_POSIX( pthread_rwlock_init(&HS_array[i].rwlock, NULL) ); … … 129 129 newhdl->data_hdl = data_hdl; 130 130 131 for (i=0; i <= HOOK_ PEER_LAST; i++) {131 for (i=0; i <= HOOK_LAST; i++) { 132 132 fd_list_init(&newhdl->chain[i], newhdl); 133 133 if (type_mask & (1<<i)) { … … 149 149 CHECK_PARAMS( handler ); 150 150 151 for (i=0; i <= HOOK_ PEER_LAST; i++) {151 for (i=0; i <= HOOK_LAST; i++) { 152 152 if ( ! FD_IS_LIST_EMPTY(&handler->chain[i])) { 153 153 CHECK_POSIX( pthread_rwlock_wrlock(&HS_array[i].rwlock) ); … … 272 272 va_start(ap, dummy); 273 273 while ((next = va_arg(ap, int)) >= 0) { 274 if (next > HOOK_ PEER_LAST)274 if (next > HOOK_LAST) 275 275 break; /* invalid parameter */ 276 276 ret |= (1<<next); … … 285 285 { 286 286 struct fd_list * li; 287 ASSERT(type <= HOOK_ PEER_LAST);287 ASSERT(type <= HOOK_LAST); 288 288 int call_default = 0; 289 289
Note: See TracChangeset
for help on using the changeset viewer.