/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <errno.h>
#include <pthread.h>
#include <sip.h>
#include "sip_msg.h"
/*
* Generic function to get int or string value from a header
*/
static void *
int *error)
{
*error = 0;
return (NULL);
}
switch (val_type) {
case (SIP_INT_VAL):
case (SIP_STR_VAL):
case (SIP_STRS_VAL):
return (NULL);
}
return (NULL);
case (SIP_INTSTR_VAL):
return (&(val->intstr_str));
else
return (NULL);
}
return (&(val->intstr_int));
case (SIP_AUTH_VAL):
}
return (NULL);
}
/*
* Generic function to get value from a header given the value type and
* the string info (for multi-string values).
*/
static void *
{
*error = 0;
return (NULL);
}
return (NULL);
}
return (NULL);
}
}
/*
* Get the URI from the value
*/
const sip_str_t *
{
*error = 0;
return (NULL);
}
/*
* If the value is BAD, update error to reflect it.
*/
}
/*
* Get display name from the value
*/
const sip_str_t *
{
*error = 0;
return (NULL);
}
/*
* If the value is BAD, update error to reflect it.
*/
}
/*
* Contact header can have more than one value
* so we require a value to be passed in to get a value.
*/
const sip_str_t *
{
}
/*
* Contact header can have more than one value
* so we require a value to be passed in to get a value.
*/
const sip_str_t *
{
}
/*
* Route header can have more than one value
* so we require a value to be passed in to get a value.
*/
const sip_str_t *
{
}
/*
* Route header can have more than one value
* so we require a value to be passed in to get a value.
*/
const sip_str_t *
{
}
/*
* Get URI from the SIP message
*/
const sip_str_t *
{
*error = 0;
return (NULL);
}
return (NULL);
}
return (NULL);
}
/*
* If the value is BAD, update error to reflect it.
*/
}
/*
* Get display name from the SIP message
*/
const sip_str_t *
{
*error = 0;
return (NULL);
}
return (NULL);
}
return (NULL);
}
/*
* If the value is BAD, update error to reflect it.
*/
}
/*
* Get FROM URI
*/
const sip_str_t *
{
}
/*
* Get FROM display name
*/
const sip_str_t *
{
}
/*
* Return the FROM tag
*/
const sip_str_t *
{
*error = 0;
return (NULL);
}
return (NULL);
}
return (NULL);
}
/*
* If the value is BAD, update error to reflect it.
*/
}
/*
* Get TO URI
*/
const sip_str_t *
{
}
/*
* Get TO display name
*/
const sip_str_t *
{
}
/*
* Get TO tag
*/
const sip_str_t *
{
*error = 0;
return (NULL);
}
return (NULL);
}
return (NULL);
}
/*
* If the value is BAD, update error to reflect it.
*/
}
/*
* Return the Call-Id
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
*/
static void *
{
*error = 0;
return (NULL);
}
return (NULL);
}
return (NULL);
}
switch (type) {
case SIP_CSEQ_NUM:
case SIP_CSEQ_METHOD:
return (&(val->cseq_method));
}
return (NULL);
}
/*
* Get CSEQ number
*/
int
{
int *r;
return (r == NULL ? -1 : *r);
}
/*
* Get CSEQ method
*/
{
sip_method_t *r;
return (r == NULL ? -1 : *r);
}
/*
* Via header can have more than one value
* so we require a value to be passed in.
*/
const sip_str_t *
{
*error = 0;
return (NULL);
}
return (&via_value->via_sent_by_host);
}
/*
* Via header can have more than one value
* so we require a value to be passed in.
*/
int
{
*error = 0;
return (-1);
}
return (via_value->via_sent_by_port);
}
/*
* Return the protocol version from the VIA value
*/
const sip_str_t *
{
return (NULL);
}
return (&via_value->via_protocol_vers);
}
/*
* Return the protocol name
*/
const sip_str_t *
{
*error = 0;
return (NULL);
}
return (&via_value->via_protocol_name);
}
/*
* Return the transport from the VIA value
*/
const sip_str_t *
{
*error = 0;
return (NULL);
}
return (&via_value->via_protocol_transport);
}
/*
* get the branch id from the topmost VIA header
*/
char *
{
char *bid;
*error = 0;
return (NULL);
}
return (NULL);
}
return (NULL);
}
if (parsed_header == NULL) {
return (NULL);
}
return (NULL);
}
"branch", error);
if (param_value == NULL) {
return (NULL);
}
return (NULL);
}
return (bid);
}
/*
* adds branchid to the topmost VIA header, if a branchid already exists,
* returns error.
*/
int
{
int err = 0;
char *param;
int plen;
return (EINVAL);
/*
* If there is already a branchid param, error?
*/
return (EINVAL);
return (EINVAL);
return (ENOMEM);
return (err);
}
/*
* returns the number of VIA headers in the SIP message
*/
int
{
int via_cnt = 0;
*error = 0;
return (via_cnt);
}
via_cnt++;
hdr);
}
return (via_cnt);
}
/*
* Return Max-Forward value
*/
int
{
int *r;
if (r == NULL)
return (-1);
return (*r);
}
/*
* Get the content type
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* Get the content sub-type
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* Return the content-length value
*/
int
{
int *r;
if (r == NULL)
return (-1);
return (*r);
}
/*
* get allow-events
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get event
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get subscription state
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get accept type
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get accept subtype
*/
const sip_str_t *
{
sip_str_t *r;
error);
return (r);
}
/*
* accept-encode can have more than one value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* accept-language can have more than one value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get URI from the alert-info header
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get method from allow header
*/
{
int *r;
}
/*
* get URI from call-info header
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get content-disposition value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get content-encoding value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get content-language value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* sip_get_date_time, day, wkday, month, year
*/
/*
* get date information
*/
static void *
{
*error = 0;
return (NULL);
}
return (NULL);
}
return (NULL);
}
switch (type) {
case (D_TIME):
case (D_DAY):
case (D_MONTH):
case (D_YEAR):
case (D_WKDAY):
case (D_TIMEZONE):
}
return (NULL);
}
/*
* get time value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get day
*/
int
{
int *r = NULL;
return (r == NULL ? -1 : *(int *)r);
}
/*
* get month
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get year
*/
int
{
int *r;
return (r == NULL ? -1 : *r);
}
/*
* get day of the week
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get the timezone
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get error-info URI
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get priv-value from privacy
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* return expires value
*/
int
{
int *r;
if (r == NULL)
return (-1);
return (*r);
}
/*
* get reply-to value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get min-expires value
*/
int
{
int *r;
if (r == NULL)
return (-1);
return (*r);
}
/*
* get mime-version
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get organization value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get priority value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get display name
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get URI
*/
const sip_str_t *
{
sip_str_t *r;
error);
return (r);
}
/*
* get display name from passerted-identity header
*/
const sip_str_t *
{
}
/*
* get URI from passerted-identity header
*/
const sip_str_t *
{
}
/*
* get display name from ppreferred-identity header
*/
const sip_str_t *
{
}
/*
* get URI from ppreferred-identity header
*/
const sip_str_t *
{
}
/*
* Get rack information
*/
static void *
{
*error = 0;
return (NULL);
}
return (NULL);
}
return (NULL);
}
switch (type) {
case SIP_RACK_RESP_NUM:
case SIP_RACK_CSEQ_NUM:
case SIP_RACK_METHOD:
return (&(val->rack_method));
}
return (NULL);
}
/*
* get response number for rack
*/
int
{
int *r;
return (r == NULL ? -1 : *r);
}
/*
* get sequence number for rack
*/
int
{
int *r;
return (r == NULL ? -1 : *r);
}
/*
* get method for rack
*/
{
sip_method_t *r;
return (r == NULL ? -1 : *r);
}
/*
* get response number from rseq
*/
int
{
int *r;
return (r == NULL ? -1 : *r);
}
/*
* get reply-to display name
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get reply-to URI
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get require value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get retry-after time
*/
int
{
int *t;
if (t == NULL)
return (-1);
return (*t);
}
/*
* get retry-after comments
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get subject
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get supported
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get timestamp delay
*/
const sip_str_t *
{
sip_str_t *t;
return (t);
}
/*
* get timestamp
*/
const sip_str_t *
{
sip_str_t *t;
return (t);
}
/*
* get unsupported value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get server value from message
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get user-agent value
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get warning info
*/
static void *
{
*error = 0;
return (NULL);
}
return (NULL);
}
switch (info) {
case (W_CODE):
case (W_AGENT):
case (W_TEXT):
}
return (NULL);
}
/*
* get warning code
*/
int
{
int *c;
*error = 0;
return (-1);
}
if (c == NULL)
return (-1);
return (*c);
}
/*
* get warning agent
*/
const sip_str_t *
{
sip_str_t *r;
return (NULL);
}
return (r);
}
/*
* get warning text
*/
const sip_str_t *
{
sip_str_t *r;
return (NULL);
}
return (r);
}
/*
* get authorization scheme
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get authentication parameter
*/
static const sip_str_t *
{
*error = 0;
return (NULL);
}
return (NULL);
}
return (NULL);
}
return (¶m->param_value);
return (NULL);
}
/*
* get authentication parameter
*/
const sip_str_t *
{
const sip_str_t *r;
return (r);
}
/*
* get authentication info
*/
const sip_str_t *
{
sip_str_t *r;
*error = 0;
return (NULL);
}
return (r);
}
/*
* get proxy-authentication scheme
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get proxy authentication parameter
*/
const sip_str_t *
{
const sip_str_t *r;
return (r);
}
/*
* get proxy-authorization scheme
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get proxy-authorization parameter
*/
const sip_str_t *
{
const sip_str_t *r;
return (r);
}
/*
* get proxy-require
*/
const sip_str_t *
{
sip_str_t *r;
*error = 0;
return (NULL);
}
return (r);
}
/*
* get www-authentication scheme
*/
const sip_str_t *
{
sip_str_t *r;
return (r);
}
/*
* get www-authentication parameter
*/
const sip_str_t *
{
const sip_str_t *r;
return (r);
}