X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=asn%2Fproto.c;h=60aba87444fe97aa8260846ca89205c2817a669d;hb=b44b4c3587d6a479d12f91c1ce38eaf533fb4980;hp=04890b8228ccc0b7f7b7cfd4aeaa3c6df42f0ff8;hpb=4e215eddb8432b3b39b70a106e2d7f45f3c68211;p=yaz-moved-to-github.git diff --git a/asn/proto.c b/asn/proto.c index 04890b8..60aba87 100644 --- a/asn/proto.c +++ b/asn/proto.c @@ -4,7 +4,16 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: proto.c,v $ - * Revision 1.4 1995-02-10 15:54:30 quinn + * Revision 1.7 1995-03-07 16:29:33 quinn + * Added authentication stuff. + * + * Revision 1.6 1995/03/01 14:46:03 quinn + * Fixed protocol bug in 8777query. + * + * Revision 1.5 1995/02/14 11:54:22 quinn + * Fixing include. + * + * Revision 1.4 1995/02/10 15:54:30 quinn * Small adjustments. * * Revision 1.3 1995/02/09 15:51:39 quinn @@ -65,7 +74,7 @@ int z_InitRequest(ODR o, Z_InitRequest **p, int opt) 5, 0) && odr_implicit(o, odr_integer, &pp->maximumRecordSize, ODR_CONTEXT, 6, 0) && - odr_implicit(o, odr_visiblestring, &pp->idAuthentication, ODR_CONTEXT, + odr_explicit(o, odr_any, &pp->idAuthentication, ODR_CONTEXT, 7, 1) && odr_implicit(o, odr_visiblestring, &pp->implementationId, ODR_CONTEXT, 110, 1) && @@ -94,8 +103,6 @@ int z_InitResponse(ODR o, Z_InitResponse **p, int opt) odr_implicit(o, odr_integer, &pp->maximumRecordSize, ODR_CONTEXT, 6, 0) && odr_implicit(o, odr_bool, &pp->result, ODR_CONTEXT, 12, 0) && - odr_implicit(o, odr_visiblestring, &pp->idAuthentication, ODR_CONTEXT, - 7, 1) && odr_implicit(o, odr_visiblestring, &pp->implementationId, ODR_CONTEXT, 110, 1) && odr_implicit(o, odr_visiblestring, &pp->implementationName, ODR_CONTEXT, @@ -106,6 +113,22 @@ int z_InitResponse(ODR o, Z_InitResponse **p, int opt) odr_sequence_end(o); } +int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt) +{ + if (!odr_sequence_begin(o, p, sizeof(**p))) + return opt; + return + odr_visiblestring(o, &(*p)->user, 0) && + odr_visiblestring(o, &(*p)->password, 0) && + odr_visiblestring(o, &(*p)->account, 0) && + odr_sequence_end(o); +} + +int z_StrAuthentication(ODR o, char **p, int opt) +{ + return odr_visiblestring(o, p, opt); +} + /* ------------------------ SEARCH SERVICE ----------------------- */ int z_ElementSetName(ODR o, char **p, int opt) @@ -290,7 +313,7 @@ int z_Query(ODR o, Z_Query **p, int opt) static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Query_type_1, z_RPNQuery}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Query_type_2, odr_octetstring}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Query_type_2, odr_octetstring}, {-1, -1, -1, -1, 0} };