Moved oid from odr/asn to util.
authorSebastian Hammer <quinn@indexdata.com>
Mon, 29 May 1995 08:11:30 +0000 (08:11 +0000)
committerSebastian Hammer <quinn@indexdata.com>
Mon, 29 May 1995 08:11:30 +0000 (08:11 +0000)
include/backend.h
include/comstack.h
include/odr.h
include/oid.h
include/proto.h
include/prt.h
odr/odr_oid.c
odr/odr_util.c

index 8296e63..78d670a 100644 (file)
@@ -29,6 +29,7 @@
 #define BACKEND_H
 
 #include <proto.h>
+#include <statserv.h>
 
 typedef struct bend_initrequest
 {
index 304b6cf..42c8b03 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: comstack.h,v $
- * Revision 1.4  1995-05-16 08:50:29  quinn
+ * Revision 1.5  1995-05-29 08:11:31  quinn
+ * Moved oid from odr/asn to util.
+ *
+ * Revision 1.4  1995/05/16  08:50:29  quinn
  * License, documentation, and memory fixes
  *
  * Revision 1.3  1995/04/20  15:12:44  quinn
@@ -78,6 +81,7 @@
 #ifndef COMSTACK_H
 #define COMSTACK_H
 
+#include <oid.h>
 #include <dmalloc.h>
 
 #define COMSTACK_DEFAULT_TIMEOUT -1
@@ -109,9 +113,7 @@ struct comstack
 #define CS_DISCON     2
 #define CS_LISTEN     3
 #define CS_DATA       4
-    int protocol;  /* what application protocol are we talking? */
-#define CS_Z3950      0
-#define CS_SR         1
+    enum oid_proto protocol;  /* what application protocol are we talking? */
     int (*f_look)(COMSTACK handle);
     int (*f_put)(COMSTACK handle, char *buf, int size);
     int (*f_get)(COMSTACK handle, char **buf, int *bufsize);
index 8aeb5ab..065323b 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: odr.h,v $
- * Revision 1.6  1995-05-22 14:47:00  quinn
+ * Revision 1.7  1995-05-29 08:11:32  quinn
+ * Moved oid from odr/asn to util.
+ *
+ * Revision 1.6  1995/05/22  14:47:00  quinn
  * ODR_NULLVAL --> void
  *
  * Revision 1.5  1995/05/22  11:31:24  quinn
@@ -161,7 +164,6 @@ typedef struct odr_bitmask
     int top;
 } Odr_bitmask;
 
-#define ODR_OID_SIZE 100
 typedef int Odr_oid;   /* terminate by -1 */
 
 typedef struct odr_constack
index 33aac90..af5a0c9 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: oid.h,v $
- * Revision 1.2  1995-05-16 08:50:35  quinn
+ * Revision 1.3  1995-05-29 08:11:33  quinn
+ * Moved oid from odr/asn to util.
+ *
+ * Revision 1.2  1995/05/16  08:50:35  quinn
  * License, documentation, and memory fixes
  *
  * Revision 1.1  1995/03/30  09:39:41  quinn
@@ -39,7 +42,7 @@
 #ifndef OID_H
 #define OID_H
 
-#include <odr.h>
+#define OID_SIZE 100
 
 typedef struct oident
 {
@@ -114,7 +117,7 @@ typedef struct oident
        VAL_EXPORTSPEC,
        VAL_EXPORTINV
     } value;
-    Odr_oid oidsuffix[20];
+    int oidsuffix[20];
     char *desc;
 } oident;
 
@@ -122,7 +125,11 @@ typedef enum oid_proto oid_proto;
 typedef enum oid_class oid_class;
 typedef enum oid_value oid_value;
 
-Odr_oid *oid_getoidbyent(struct oident *ent);
-struct oident *oid_getentbyoid(Odr_oid *o);
+int *oid_getoidbyent(struct oident *ent);
+struct oident *oid_getentbyoid(int *o);
+void oid_oidcpy(int *t, int *s);
+void oid_oidcat(int *t, int *s);
+int oid_oidcmp(int *o1, int *o2);
+int oid_oidlen(int *o);
 
 #endif
index f536d83..23e06d6 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: proto.h,v $
- * Revision 1.9  1995-05-22 11:31:25  quinn
+ * Revision 1.10  1995-05-29 08:11:34  quinn
+ * Moved oid from odr/asn to util.
+ *
+ * Revision 1.9  1995/05/22  11:31:25  quinn
  * Added PDUs
  *
  * Revision 1.8  1995/05/17  08:41:35  quinn
@@ -88,6 +91,7 @@
 #define PROTO_H
 
 #include <odr.h>
+#include <oid.h>
 #include <odr_use.h>
 
 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
index 8300f7a..8fb09e9 100644 (file)
@@ -37,10 +37,6 @@ int completeBER(unsigned char *buf, int len);
 void odr_begin(ODR o);
 void odr_end(ODR o);
 void odr_release_mem(struct odr_memblock *p);
-void odr_oidcpy(Odr_oid *t, Odr_oid *s);
-void odr_oidcat(Odr_oid *t, Odr_oid *s);
-int odr_oidcmp(Odr_oid *o1, Odr_oid *o2);
-int odr_oidlen(Odr_oid *o);
 Odr_oid *odr_oiddup(ODR odr, Odr_oid *o);
 int odr_grow_block(odr_ecblock *b, int min_bytes);
 int odr_write(ODR o, unsigned char *buf, int bytes);
index 1108a4b..f6d005d 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_oid.c,v $
- * Revision 1.9  1995-05-16 08:50:57  quinn
+ * Revision 1.10  1995-05-29 08:11:44  quinn
+ * Moved oid from odr/asn to util.
+ *
+ * Revision 1.9  1995/05/16  08:50:57  quinn
  * License, documentation, and memory fixes
  *
  * Revision 1.8  1995/03/17  10:17:55  quinn
@@ -35,6 +38,7 @@
  */
 
 #include <odr.h>
+#include <oid.h>
 
 /*
  * Top level oid en/decoder.
@@ -71,6 +75,6 @@ int odr_oid(ODR o, Odr_oid **p, int opt)
        return 1;
     }
     if (o->direction == ODR_DECODE)
-       *p = odr_malloc(o, ODR_OID_SIZE * sizeof(**p));
+       *p = odr_malloc(o, OID_SIZE * sizeof(**p));
     return ber_oidc(o, *p);
 }
index 0ea1c08..d399f9e 100644 (file)
@@ -1,5 +1,6 @@
 #include <stdlib.h>
 #include <odr.h>
+#include <oid.h>
 
 char *odr_indent(ODR o)
 {
@@ -29,52 +30,14 @@ int odp_more_chunks(ODR o, unsigned char *base, int len)
         return o->bp - base < len;
 }
 
-/* OID utilities */
-
-void odr_oidcpy(Odr_oid *t, Odr_oid *s)
-{
-    while ((*(t++) = *(s++)) > -1);
-}
-
-void odr_oidcat(Odr_oid *t, Odr_oid *s)
-{
-    while (*t > -1)
-       t++;
-    while ((*(t++) = *(s++)) > -1);
-}
-
-int odr_oidcmp(Odr_oid *o1, Odr_oid *o2)
-{
-    while (*o1 == *o2 && *o1 > -1)
-    {
-       o1++;
-       o2++;
-    }
-    if (*o1 == *o2)
-       return 0;
-    else if (*o1 > *o2)
-       return 1;
-    else
-       return -1;
-}
-
-int odr_oidlen(Odr_oid *o)
-{
-    int len = 0;
-
-    while (*(o++) >= 0)
-       len++;
-    return len;
-}
-
 Odr_oid *odr_oiddup(ODR odr, Odr_oid *o)
 {
     Odr_oid *r;
 
     if (!o)
        return 0;
-    if (!(r = odr_malloc(odr, (odr_oidlen(o) + 1) * sizeof(Odr_oid))))
+    if (!(r = odr_malloc(odr, (oid_oidlen(o) + 1) * sizeof(int))))
        return 0;
-    odr_oidcpy(r, o);
+    oid_oidcpy(r, o);
     return r;
 }