From 0172de465b10f171521a277cd60bc3549c4de7db Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sat, 19 Oct 1996 05:06:44 +0000 Subject: [PATCH] util_ordering.c (g_queue_externalize, g_queue_internalize, g_queue_size): New routines which allow the serailizing routines to access the seqstate structure. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9214 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/generic/ChangeLog | 6 +++++ src/lib/gssapi/generic/gssapiP_generic.h | 6 +++++ src/lib/gssapi/generic/util_ordering.c | 34 ++++++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/src/lib/gssapi/generic/ChangeLog b/src/lib/gssapi/generic/ChangeLog index b642e0b84..82e724ea7 100644 --- a/src/lib/gssapi/generic/ChangeLog +++ b/src/lib/gssapi/generic/ChangeLog @@ -1,3 +1,9 @@ +Sat Oct 19 00:39:25 1996 Theodore Y. Ts'o + + * util_ordering.c (g_queue_externalize, g_queue_internalize, + g_queue_size): New routines which allow the serailizing + routines to access the seqstate structure. + Thu Oct 10 15:03:38 1996 Tom Yu * configure.in: Remove calls to CopySrcHeader. diff --git a/src/lib/gssapi/generic/gssapiP_generic.h b/src/lib/gssapi/generic/gssapiP_generic.h index d6866696c..20ba1baf2 100644 --- a/src/lib/gssapi/generic/gssapiP_generic.h +++ b/src/lib/gssapi/generic/gssapiP_generic.h @@ -145,6 +145,12 @@ gss_int32 g_order_check PROTOTYPE((void **queue, OM_uint32 seqnum)); void g_order_free PROTOTYPE((void **queue)); +gss_uint32 g_queue_size(void *vqueue, size_t *sizep); +gss_uint32 g_queue_externalize(void *vqueue, unsigned char **buf, + size_t *lenremain); +gss_uint32 g_queue_internalize(void **vqueue, unsigned char **buf, + size_t *lenremain); + char *g_canonicalize_host PROTOTYPE((char *hostname)); char *g_local_host_name PROTOTYPE((void)); diff --git a/src/lib/gssapi/generic/util_ordering.c b/src/lib/gssapi/generic/util_ordering.c index 34490779b..5dc78a0d4 100644 --- a/src/lib/gssapi/generic/util_ordering.c +++ b/src/lib/gssapi/generic/util_ordering.c @@ -175,3 +175,37 @@ g_order_free(void **vqueue) *vqueue = NULL; } + +/* + * These support functions are for the serialization routines + */ +gss_uint32 +g_queue_size(void *vqueue, size_t *sizep) +{ + *sizep += sizeof(queue); + return 0; +} + +gss_uint32 +g_queue_externalize(void *vqueue, unsigned char **buf, size_t *lenremain) +{ + memcpy(*buf, vqueue, sizeof(queue)); + *buf += sizeof(queue); + *lenremain += sizeof(queue); + + return 0; +} + +gss_uint32 +g_queue_internalize(void **vqueue, unsigned char **buf, size_t *lenremain) +{ + void *q; + + if ((q = malloc(sizeof(queue))) == 0) + return ENOMEM; + memcpy(q, *buf, sizeof(queue)); + *buf += sizeof(queue); + *lenremain += sizeof(queue); + *vqueue = q; + return 0; +} -- 2.26.2