ser_addr.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* lib/krb5/krb/ser_addr.c
*
* Copyright 1995 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
*/
/*
* ser_addr.c - Serialize a krb5_address structure.
*/
#include <k5-int.h>
/*
* Routines to deal with externalizing the krb5_address:
* krb5_address_size();
* krb5_address_externalize();
* krb5_address_internalize();
*/
static krb5_error_code krb5_address_size
/* Local data */
static const krb5_ser_entry krb5_address_ser_entry = {
KV5M_ADDRESS, /* Type */
krb5_address_size, /* Sizer routine */
krb5_address_externalize, /* Externalize routine */
krb5_address_internalize /* Internalize routine */
};
/*
* krb5_address_size() - Determine the size required to externalize
* the krb5_address.
*/
/*ARGSUSED*/
static krb5_error_code
{
/*
* krb5_address requires:
* krb5_int32 for KV5M_ADDRESS
* krb5_int32 for addrtype
* krb5_int32 for length
* address->length for contents
* krb5_int32 for KV5M_ADDRESS
*/
if (address) {
*sizep += (sizeof(krb5_int32) +
sizeof(krb5_int32) +
sizeof(krb5_int32) +
sizeof(krb5_int32) +
kret = 0;
}
return(kret);
}
/*
* krb5_address_externalize() - Externalize the krb5_address.
*/
static krb5_error_code
krb5_octet **buffer;
{
krb5_octet *bp;
required = 0;
if (address) {
/* Our identifier */
/* Our addrtype */
/* Our length */
/* Our contents */
/* Finally, our trailer */
kret = 0;
}
}
return(kret);
}
/*
* krb5_address_internalize() - Internalize the krb5_address.
*/
/*ARGSUSED*/
static krb5_error_code
krb5_octet **buffer;
{
krb5_octet *bp;
/* Read our magic number */
ibuf = 0;
if (ibuf == KV5M_ADDRESS) {
/* Get a address */
/* Get the addrtype */
/* Get the length */
/* Get the string */
/* Get the trailer */
ibuf = 0;
}
else
}
if (kret) {
}
}
}
return(kret);
}
/*
* Register the address serializer.
*/
{
}