Navigation


Changeset 1128:7c5449ddc434 in freeDiameter for libfdcore


Ignore:
Timestamp:
May 15, 2013, 12:18:30 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

New macro HOOK_MASK to ease call of the fd_hook_register function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/hooks.c

    r1120 r1128  
    263263}
    264264
     265/* Create a mask */
     266uint32_t fd_hook_mask_helper(int dummy, ...)
     267{
     268        va_list ap;
     269        uint32_t ret = 0;
     270        int next;
     271       
     272        va_start(ap, dummy);
     273        while ((next = va_arg(ap, int)) >= 0) {
     274                if (next > HOOK_PEER_LAST)
     275                        break; /* invalid parameter */
     276                ret |= (1<<next);
     277        }
     278        va_end(ap);
     279
     280        return ret;
     281}
     282
    265283/* The function that does the work of calling the extension's callbacks and also managing the permessagedata structures */
    266284void   fd_hook_call(enum fd_hook_type type, struct msg * msg, struct fd_peer * peer, void * other, struct fd_msg_pmdl * pmdl)
Note: See TracChangeset for help on using the changeset viewer.