parse_privacy.h File Reference

Privacy value parser. More...

#include "../mem/mem.h"
#include "msg_parser.h"

Include dependency graph for parse_privacy.h:

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

Go to the source code of this file.

Defines

#define get_privacy_values(p_msg)   ((unsigned int)(long)((p_msg)->privacy->parsed))

Enumerations

enum  privacy_value {
  PRIVACY_USER = 1, PRIVACY_HEADER = 2, PRIVACY_SESSION = 4, PRIVACY_NONE = 8,
  PRIVACY_CRITICAL = 16, PRIVACY_ID = 32, PRIVACY_HISTORY = 64
}

Functions

unsigned int parse_priv_value (char *start, unsigned int max_len, unsigned int *value)
int parse_privacy (struct sip_msg *msg)


Detailed Description

Privacy value parser.

Definition in file parse_privacy.h.


Define Documentation

#define get_privacy_values ( p_msg   )     ((unsigned int)(long)((p_msg)->privacy->parsed))

casting macro for accessing enumeration of priv-values

Definition at line 53 of file parse_privacy.h.

Referenced by is_privacy_f().


Enumeration Type Documentation

bitmap of Privacy header privacy values (http://www.iana.org/assignments/sip-priv-values)

Enumerator:
PRIVACY_USER 
PRIVACY_HEADER 
PRIVACY_SESSION 
PRIVACY_NONE 
PRIVACY_CRITICAL 
PRIVACY_ID 
PRIVACY_HISTORY 

Definition at line 39 of file parse_privacy.h.


Function Documentation

unsigned int parse_priv_value ( char *  start,
unsigned int  max_len,
unsigned int *  value 
)

Parse a privacy value pointed by start that can be at most max_len long.

Returns:
length of matched privacy value on success or NULL otherwise

Definition at line 45 of file parse_privacy.c.

References len, LM_ERR, PRIVACY_CRITICAL, PRIVACY_HEADER, PRIVACY_HISTORY, PRIVACY_ID, PRIVACY_NONE, PRIVACY_SESSION, and PRIVACY_USER.

Referenced by fixup_privacy(), and parse_privacy().

int parse_privacy ( struct sip_msg msg  ) 

This method is used to parse Privacy HF body, which consist of comma separated list of priv-values. After parsing, msg->privacy->parsed contains enum bits of privacy values defined in parse_privacy.h.

Returns:
0 on success and -1 on failure.

Definition at line 156 of file parse_privacy.c.

References hdr_field::body, HDR_PRIVACY_F, _str::len, len, LM_ERR, parse_headers(), parse_priv_value(), hdr_field::parsed, sip_msg::privacy, PRIVACY_NONE, _str::s, and trim_leading().

Referenced by is_privacy_f().


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