util_ordering.c (g_queue_externalize, g_queue_internalize, g_queue_size):
authorTheodore Tso <tytso@mit.edu>
Sat, 19 Oct 1996 05:06:44 +0000 (05:06 +0000)
committerTheodore Tso <tytso@mit.edu>
Sat, 19 Oct 1996 05:06:44 +0000 (05:06 +0000)
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
src/lib/gssapi/generic/gssapiP_generic.h
src/lib/gssapi/generic/util_ordering.c

index b642e0b84ca9ce6c3525ff7e964b617b7e25cdb6..82e724ea73e889649cca7503a922757fc229dd4a 100644 (file)
@@ -1,3 +1,9 @@
+Sat Oct 19 00:39:25 1996  Theodore Y. Ts'o  <tytso@mit.edu>
+
+       * 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  <tlyu@mit.edu>
 
        * configure.in: Remove calls to CopySrcHeader.
index d6866696c3973b6a466834d15bc8f808ca3260d0..20ba1baf27416bc5622dcd6ffe501a32ab2b21d1 100644 (file)
@@ -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));
 
index 34490779b0c070712627f4d1756e3af5df7fd20a..5dc78a0d4ed6731477a11d96b9d41eb2d592780a 100644 (file)
@@ -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;
+}