smb_group_door_encdec.c revision dc20a3024900c47dd2ee44b9707e6df38f7d62a5
/*
* 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 <errno.h>
#include <strings.h>
#include <smbsrv/smb_door_svc.h>
/*
* smb_grplist_mkselfrel
*
* encode: structure -> flat buffer (buffer size)
* Pre-condition: obj is non-null.
*/
static uint8_t *
{
if (!obj) {
return (NULL);
}
*len = 0;
}
xdr_destroy(&xdrs);
return (buf);
}
/*
* smb_grplist_mkabsolute
*
* decode: flat buffer -> structure
*/
static ntgrp_list_t *
{
if ((obj = (ntgrp_list_t *)
malloc(sizeof (ntgrp_list_t))) == 0) {
xdr_destroy(&xdrs);
return (NULL);
}
}
xdr_destroy(&xdrs);
return (obj);
}
/*
* smb_grpmemberlist_mkselfrel
*
* encode: structure -> flat buffer (buffer size)
* Pre-condition: obj is non-null.
*/
static uint8_t *
{
if (!obj) {
"smb_grpmemberlist_mkselfrel: invalid parameter");
return (NULL);
}
"smb_grpmemberlist_mkselfrel: XDR encode error");
*len = 0;
}
xdr_destroy(&xdrs);
return (buf);
}
/*
* ntgrp_list_mkabsolute
*
* decode: flat buffer -> structure
*/
static ntgrp_member_list_t *
{
if ((obj = (ntgrp_member_list_t *)
malloc(sizeof (ntgrp_member_list_t))) == 0) {
xdr_destroy(&xdrs);
"smb_grpmemberlist_mkabsolute: resource shortage");
return (NULL);
}
"smb_grpmemberlist_mkabsolute: XDR decode error");
}
xdr_destroy(&xdrs);
return (obj);
}
/*
* smb_privlist_mkselfrel
*
* encode: structure -> flat buffer (buffer size)
* Pre-condition: obj is non-null.
*/
static uint8_t *
{
if (!obj) {
"smb_grpprivlist_mkselfrel: invalid parameter");
return (NULL);
}
if (!buf) {
"smb_grpprivlist_mkselfrel: resource shortage");
return (NULL);
}
"smb_grpprivlist_mkselfrel: XDR encode error");
*len = 0;
}
xdr_destroy(&xdrs);
return (buf);
}
/*
* smb_privlist_mkabsolute
*
* decode: flat buffer -> structure
*/
static ntpriv_list_t *
{
if (status != 0) {
"smb_grpprivlist_mkabsolute: Cannot get privlist.");
xdr_destroy(&xdrs);
return (NULL);
}
if (num_privs > 0) {
"smb_grpprivlist_mkabsolute: resource shortage");
xdr_destroy(&xdrs);
return (NULL);
}
}
}
xdr_destroy(&xdrs);
return (obj);
}
char *
{
char *buf;
return (buf);
}
{
!= 0) {
return (NULL);
}
return (list);
}
char *
{
char *buf;
return (buf);
}
{
!= 0) {
"smb_dr_decode_grpmemberlist: XDR decode error");
return (NULL);
}
return (list);
}
char *
{
char *buf;
return (buf);
}
{
!= 0) {
return (NULL);
}
return (list);
}