/*
* 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 <string.h>
#include <fcntl.h>
#include <pthread.h>
#include <unistd.h>
#include <sip.h>
#ifdef __linux__
#include <sasl/saslplug.h>
#else
#endif
#include "sip_miscdefs.h"
#include "sip_msg.h"
void sip_md5_hash(char *, int, char *, int, char *, int, char *, int,
char *, int, char *, int, uchar_t *);
/*
*/
static int
{
if (devrandom == -1 &&
return (-1);
}
return (-1);
return (0);
}
/*
* Get MD5 hash of call_id, from_tag, to_tag using key
*/
void
{
#ifdef __linux__
_sasl_MD5Init(&ctx);
#else /* solaris */
#endif
}
/*
* generate a guid (globally unique id)
*/
char *
sip_guid()
{
int i;
uint8_t *r;
char *guid;
int guidlen;
#ifdef __linux__
#endif
return (NULL);
/*
* Get a 32-bit random #
*/
return (NULL);
#ifdef __linux__
return (NULL);
#else
/*
* Get 32-bits from gethrtime()
*/
#endif
/*
* just throw in some alphabets too
*/
if (sip_get_random((char *)r, guidlen) != 0) {
return (NULL);
}
for (i = 0; i < guidlen; i++) {
if ((r[i] >= 65 && r[i] <= 90) ||
(r[i] >= 97 && r[i] <= 122)) {
guid[i] = r[i];
}
}
free(r);
return (guid);
}
/*
* Generate branchid for a transaction
*/
char *
{
char *guid;
char *branchid;
int cseq;
int hdrlen;
int i;
return (NULL);
return (NULL);
}
guid);
return (branchid);
}
goto generate_bid;
}
return (NULL);
sip_str_ptr == NULL) {
return (NULL);
}
return (NULL);
#ifdef __linux__
_sasl_MD5Init(&ctx);
#else /* solaris */
#endif
for (i = 0; i < sizeof (md5_hash); i++) {
md5_hash[i]);
}
return (branchid);
}
{
}
{
}