/*
* 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 <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include <pthread.h>
#include <strings.h>
#include <sip.h>
#include "sip_miscdefs.h"
/*
* Local version of case insensitive strstr().
*/
static char *
{
const char *s1;
const char *s2;
const char *tptr;
char c;
return ((char *)s1);
c = *s2;
while (*s1)
;
if (c == 0)
return ((char *)tptr - 1);
c = *s2;
}
return (NULL);
}
/*
* Get the value in the content-length field and add it to the header length
* and return the total length. returns -1 if the length cannot be determined
* or if the message does not contain the entire message.
*/
static int
{
int value = 0;
int hlen;
char *c;
char *e;
char *edge;
int digits = 0;
return (-1);
hlen = c - p;
return (-1);
c += strlen("content-length");
e = c + 1;
while (*e == ' ' || *e == ':') {
e++;
if (e == edge)
return (-1);
}
while (*e != '\r' && *e != ' ') {
if (e == edge)
return (-1);
if (*e >= '0' && *e <= '9')
digits = *e - '0';
else
return (-1);
e++;
}
while (*e != '\r') {
e++;
if (e == edge)
return (-1);
}
return (value);
}
/*
* We have determined that msg does not contain a *single* complete message.
* Add it to the reassembly list and check if we have a complete message.
* a NULL 'msg' means we are just checking if there are more complete
* messages in the list that can be passed up.
*/
char *
{
int value;
void **obj_val;
int splitlen;
char *splitbuf;
return (NULL);
}
/*
* connection object not initialized
*/
return (NULL);
return (msg);
} else {
return (NULL);
}
}
(void) pthread_mutex_unlock(
return (NULL);
}
(void) pthread_mutex_unlock(
return (msg);
}
goto tryone;
return (NULL);
/*
* Resize, not optimal
*/
char *newmsg;
(void) pthread_mutex_unlock(
return (NULL);
}
}
return (NULL);
}
reass->sip_reass_msglen = 0;
return (msg);
}
return (NULL);
}
return (msg);
}