t_cancel.h File Reference

TM :: CANCEL handling. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define BUSY_BUFFER   ((char *)-1)
 A buffer is empty but cannot be used by anyone else.

Typedefs

typedef unsigned int(* tuaccancel_f )(str *headers, str *body, unsigned int cancelledIdx, unsigned int cancelledLabel, transaction_cb cb, void *cbp)

Functions

char * build_cancel (struct cell *Trans, unsigned int branch, unsigned int *len)
void cancel_branch (struct cell *t, int branch)
void cancel_uacs (struct cell *t, branch_bm_t cancel_bm)
 cancel branches scheduled for deletion
static short should_cancel_branch (struct cell *t, int b)
unsigned int t_uac_cancel (str *headers, str *body, unsigned int cancelledIdx, unsigned int cancelledLabel, transaction_cb cb, void *cbp)
 This function cancels a previously created local invite transaction.
int unixsock_uac_cancel (str *msg)
void which_cancel (struct cell *t, branch_bm_t *cancel_bm)
 Determine which branches should be canceled.


Detailed Description

TM :: CANCEL handling.

Definition in file t_cancel.h.


Define Documentation

#define BUSY_BUFFER   ((char *)-1)

A buffer is empty but cannot be used by anyone else.

particularly, we use this value in the buffer pointer in local_buffer to tell "a process is already scheduled to generate a CANCEL, other processes are not supposed to" (which might happen if for example in a three-branch forking, two 200 would enter separate processes and compete for canceling the third branch); note that to really avoid race conditions, the value must be set in REPLY_LOCK

Definition at line 48 of file t_cancel.h.

Referenced by cancel_branch(), free_cell(), should_cancel_branch(), and t_cancel_branches().


Typedef Documentation

typedef unsigned int(* tuaccancel_f)(str *headers, str *body, unsigned int cancelledIdx, unsigned int cancelledLabel, transaction_cb cb, void *cbp)

Definition at line 59 of file t_cancel.h.


Function Documentation

char* build_cancel ( struct cell Trans,
unsigned int  branch,
unsigned int *  len 
)

Definition at line 124 of file t_cancel.c.

References build_local(), CANCEL, CANCEL_LEN, and cell::to.

Referenced by cancel_branch().

void cancel_branch ( struct cell t,
int  branch 
)

void cancel_uacs ( struct cell t,
branch_bm_t  cancel_bm 
)

cancel branches scheduled for deletion

Definition at line 69 of file t_cancel.c.

References cancel_branch(), and cell::nr_of_outgoings.

Referenced by _reply_light(), cancel_invite(), local_reply(), mi_tm_cancel(), relay_reply(), reply_received(), and t_cancel_branches().

static short should_cancel_branch ( struct cell t,
int  b 
) [inline, static]

unsigned int t_uac_cancel ( str headers,
str body,
unsigned int  cancelled_hashIdx,
unsigned int  cancelled_label,
transaction_cb  cb,
void *  cbp 
)

int unixsock_uac_cancel ( str msg  ) 

void which_cancel ( struct cell t,
branch_bm_t cancel_bm 
)

Determine which branches should be canceled.

Do it only from within REPLY_LOCK, otherwise collisions could occur (e.g., two 200 for two branches processed by two processes might concurrently try to generate a CANCEL for the third branch, resulting in race conditions during writing to cancel buffer

Definition at line 56 of file t_cancel.c.

References cell::first_branch, and should_cancel_branch().

Referenced by _reply_light(), cancel_invite(), local_reply(), t_cancel_branches(), and t_should_relay_response().


Generated on Thu May 24 20:00:44 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6