#define GASNBITS_PRESENT(abits) ((abits)->value.bits != NULL)
#define COMPONENTBITS_PRESENT(abits) ((abits)->value.bits != NULL)
+int GEncComponentBits (GenBuf *b, ComponentBits* bits);
int GDecComponentBits (void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentBits (void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
int MatchingComponentBits (char* oid, ComponentSyntaxInfo *bits1 , ComponentSyntaxInfo* bits2);
BMPString value;
} ComponentBMPString;
+int GEncComponentBMPString (GenBuf *b, ComponentBMPString* bmp);
int GDecComponentBMPString (void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentBMPString (void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
#define MatchingComponentBMPString MatchingComponentOcts
AsnBool value;
} ComponentBool;
+int GEncComponentBool (GenBuf *b, ComponentBool * bool );
int GDecComponentBool ( void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentBool ( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
int MatchingComponentBool (char* oid, ComponentSyntaxInfo *a, ComponentSyntaxInfo *b);
struct berval value_identifier;/*Why this value is defined here?*/
} ComponentEnum;
+int GEncComponentEnum (GenBuf *b, ComponentEnum* comp_enum);
int GDecComponentEnum ( void* mem_op, GenBuf *a, void *result, AsnLen *bytesDecoded,int mode);
int BDecComponentEnum ( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
int MatchingComponentEnum (char *oid, ComponentSyntaxInfo *a, ComponentSyntaxInfo * b);
IA5String value;
} ComponentIA5String;
+#define GEncComponentIA5String GEncComponentUTF8String
#define GDecComponentIA5String GDecComponentUTF8String
int BDecComponentIA5String ( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
#define MatchingComponentIA5String MatchingComponentOcts
} ComponentInt;
#define GNOT_NULL(ptr) ((ptr) != NULL)
-
+int GEncComponentInt (GenBuf *b, ComponentInt *comp_int);
int GDecComponentInt ( void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode );
int BDecComponentInt ( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
int MatchingComponentInt (char* oid, ComponentSyntaxInfo *a, ComponentSyntaxInfo *b);
AsnNull value;
} ComponentNull;
+int GEncComponentNull (GenBuf *b, ComponentNull* comp_null);
int GDecComponentNull ( void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentNull ( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentNullTag ( void* mem_op, GenBuf *b, void *v, AsnLen *bytesDecoded, int mode );
NumericString value;
} ComponentNumericString;
+#define GEncComponentNumericString GEncComponentUTF8String
#define GDecComponentNumericString GDecComponentUTF8String
int BDecComponentNumericString ( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
#define MatchingComponentNumericString MatchingComponentOcts
} ComponentOcts;
#define GASNOCTS_PRESENT(aocts) ((aocts)->value.octs != NULL)
-
+int GEncComponentOcts (GenBuf *b, ComponentOcts *octs);
int GDecComponentOcts (void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentOcts (void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
int MatchingComponentOcts (char* oid, ComponentSyntaxInfo *a, ComponentSyntaxInfo *b);
} ComponentOid;
#define GASNOID_PRESENT(aoid) ASNOCTS_PRESENT(aoid)
-
+int GEncComponentOid (GenBuf *b, ComponentOid *oid);
int GDecComponentOid (void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentOid (void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
int MatchingComponentOid (char* oid, ComponentSyntaxInfo *a, ComponentSyntaxInfo *b);
char id_buf[MAX_IDENTIFIER_LEN];
PrintableString value;
} ComponentPrintableString;
-
+#define GEncComponentPrintableString GEncComponentUTF8String
#define GDecComponentPrintableString GDecComponentUTF8String
int BDecComponentPrintableString (void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentPrintableStringTag (void* mem_op, GenBuf *b, void *v, AsnLen *bytesDecoded, int mode );
AsnReal value;
} ComponentReal;
+int GEncComponentReal (GenBuf *b, ComponentReal* comp_real);
int GDecComponentReal (void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentReal (void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
int MatchingComponentReal (char* oid, ComponentSyntaxInfo *a, ComponentSyntaxInfo *b);
AsnRelativeOid value;
} ComponentRelativeOid;
+int GEncComponentRelativeOid (GenBuf *b, ComponentRelativeOid *r_oid);
int GDecComponentRelativeOid ( void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentRelativeOid ( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
int MatchingComponentRelativeOid (char* oid, ComponentSyntaxInfo *a, ComponentSyntaxInfo *b);
TeletexString value;
} ComponentTeletexString;
+int GEncComponentTeletexString (GenBuf *b, ComponentTeletexString * tel_str);
int GDecComponentTeletexString ( void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode );
#define BDecComponentTeletexString BDecComponentOcts
#define MatchingComponentTeletexString MatchingComponentOcts
UniversalString value;
} ComponentUniversalString;
+int GEncComponentUniversalString (GenBuf *b, ComponentUniversalString* uni_str);
int GDecComponentUniversalString ( void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentUniversalString ( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
#define MatchingComponentUniversalString MatchingComponentOcts
UTF8String value;
} ComponentUTF8String;
+int GEncComponentUTF8String (GenBuf *b, ComponentUTF8String * utf_str);
int GDecComponentUTF8String (void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode);
int BDecComponentUTF8String (void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
#define MatchingComponentUTF8String MatchingComponentOcts
VisibleString value;
} ComponentVisibleString;
+#define GEncComponentVisibleString GEncComponentUTF8String
#define GDecComponentVisibleString GDecComponentUTF8String
int BDecComponentVisibleString (void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *result, AsnLen *bytesDecoded, int mode);
#define MatchingComponentVisibleString MatchingComponentOcts
#define MatchingComponentAnyDefinedBy MatchingComponentAny
#define FreeComponentAnyDefinedBy FreeComponentAny
+int GEncComponentAny (GenBuf *b, ComponentAny *comp_any);
int BDecComponentAny ( void* mem_op, GenBuf *b, ComponentAny *result, AsnLen *bytesDecoded, int mode);
int GDecComponentAny ( void* mem_op, GenBuf *b, ComponentAny *result, AsnLen *bytesDecoded, int mode);
int MatchingComponentAny (char* oid, ComponentAny *a, ComponentAny *b);
* UTCTime
*/
typedef ComponentVisibleString ComponentUTCTime;
+int GEncComponentUTCTime( GenBuf* b, ComponentUTCTime* utc_time);
#define GDecComponentUTCTime GDecComponentVisibleString
#define BDecComponentUTCTime BDecComponentOcts
#define MatchingComponentUTCTime MatchingComponentOcts
* GeneralizedTime
*/
typedef ComponentVisibleString ComponentGeneralizedTime;
+int GEncComponentGeneralizedTime (GenBuf *b, ComponentGeneralizedTime *gen_time);
#define GDecComponentGeneralizedTime GDecComponentVisibleString
#define BDecComponentGeneralizedTime BDecComponentOcts
#define MatchingComponentGeneralizedTime MatchingComponentOcts
FreeAsnBits( &v->value );
}
+/*
+ * GSER Encoder : BIT STRING
+ */
+int
+GEncComponentBits ( GenBuf *b, ComponentBits *in )
+{
+ if ( !in )
+ return (-1);
+ return GEncAsnBitsContent ( b, &in->value );
+}
+
+
/*
* GSER Decoder : BIT STRING
*/
return LDAP_SUCCESS;
}
+/*
+ * Component GSER BMPString Encoder
+ */
+ int
+ GEncComponentBMPString ( GenBuf *b, ComponentBMPString *in )
+ {
+ if ( !in || in->value.octetLen <= 0 ) return (-1);
+ return GEncBMPStringContent ( b, &in->value );
+ }
+
/*
* Component GSER BMPString Decoder
*/
}
+/*
+ * Component GSER Encoder : UTF8 String
+ */
+int
+GEncComponentUTF8String ( GenBuf *b, ComponentUTF8String *in )
+{
+ if ( !in || in->value.octetLen <= 0 )
+ return (-1);
+ return GEncUTF8StringContent ( b, &in->value );
+}
+
/*
* Component GSER Decoder : UTF8 String
*/
k->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentUTF8String;
}
+/*
+ * Component GSER Encoder : Teletex String
+ */
+int
+GEncComponentTeletexString ( GenBuf *b, ComponentTeletexString *in )
+{
+ if ( !in || in->value.octetLen <= 0 )
+ return (-1);
+ return GEncTeletexStringContent ( b, &in->value );
+}
+
/*
* Component GSER Decoder : Teletex String
*/
return (a->value == b->value) ? LDAP_COMPARE_TRUE:LDAP_COMPARE_FALSE;
}
+/*
+ * GSER Encoder : BOOLEAN
+ */
+int
+GEncComponentBool ( GenBuf *b, ComponentBool *in )
+{
+ if ( !in )
+ return (-1);
+ return GEncAsnBoolContent ( b, &in->value );
+}
+
/*
* GSER Decoder : BOOLEAN
*/
return rc ? LDAP_COMPARE_TRUE:LDAP_COMPARE_FALSE;
}
+/*
+ * GSER Encoder : ENUMERATE
+ */
+int
+GEncComponentEnum ( GenBuf *b, ComponentEnum *in )
+{
+ if ( !in )
+ return (-1);
+ return GEncAsnEnumContent ( b, &in->value );
+}
+
/*
* GSER Decoder : ENUMERATE
*/
}
/*
- * IA5String
+ * Component GSER Encoder : IA5String
*/
+int
+GEncComponentIA5Stirng ( GenBuf *b, ComponentIA5String* in )
+{
+ if ( !in || in->value.octetLen <= 0 ) return (-1);
+ return GEncIA5StringContent( b, &in->value );
+}
+
/*
* Component BER Decoder : IA5String
*/
return ( a->value == b->value ) ? LDAP_COMPARE_TRUE:LDAP_COMPARE_FALSE;
}
+/*
+ * GSER Encoder : INTEGER
+ */
+int
+GEncComponentInt ( GenBuf *b, ComponentInt* in )
+{
+ if ( !in ) return (-1);
+ return GEncAsnIntContent ( b, &in->value );
+}
+
/*
* GSER Decoder : INTEGER
*/
return (a->value == b->value) ? LDAP_COMPARE_TRUE:LDAP_COMPARE_FALSE;
}
+/*
+ * GSER Encoder : NULL
+ */
+int
+GEncComponentNull ( GenBuf *b, ComponentNull *in )
+{
+ if ( !in ) return (-1);
+ return GEncAsnNullContent ( b, &in->value );
+}
+
/*
* GSER Decoder : NULL
*/
return LDAP_COMPARE_FALSE;
}
+/*
+ * GSER Encoder : OCTET STRING
+ */
+int
+GEncComponentOcts ( GenBuf* b, ComponentOcts *in )
+{
+ if ( !in || in->value.octetLen <= 0 )
+ return (-1);
+ return GEncAsnOctsContent ( b, &in->value );
+}
+
/*
* GSER Decoder : OCTET STRING
*/
return rc ? LDAP_COMPARE_TRUE:LDAP_COMPARE_FALSE;
}
+/*
+ * GSER Encoder : OID
+ */
+GEncComponentOid ( GenBuf *b, ComponentOid *in )
+{
+ if ( !in || in->value.octetLen <= 0 ) return (-1);
+ return GEncAsnOidContent( b, &in->value );
+}
+
/*
* GSER Decoder : OID
*/
return rc ? LDAP_COMPARE_TRUE:LDAP_COMPARE_FALSE;
}
+/*
+ * GSER Encoder : Real
+ */
+int
+GEncComponentReal ( GenBuf *b, ComponentReal *in )
+{
+ if ( !in )
+ return (-1);
+ return GEncAsnRealContent ( b, &in->value );
+}
+
/*
* GSER Decoder : Real
*/
return rc ? LDAP_COMPARE_TRUE:LDAP_COMPARE_FALSE;
}
+/*
+ * GSER Encoder : RELATIVE_OID.
+ */
+int
+GEncComponentRelativeOid ( GenBuf *b, ComponentRelativeOid *in )
+{
+ if ( !in || in->value.octetLen <= 0 )
+ return (-1);
+ return GEncAsnRelativeOidContent ( b , &in->value );
+}
+
/*
* GSER Decoder : RELATIVE_OID.
*/
}
/*
- * GSER Decoder : UniverseString
+ * GSER Encoder : UniversalString
+ */
+int
+GEncComponentUniversalString ( GenBuf *b, ComponentUniversalString *in )
+{
+ if ( !in || in->value.octetLen <= 0 )
+ return (-1);
+ return GEncUniversalStringContent( b, &in->value );
+}
+
+/*
+ * GSER Decoder : UniversalString
*/
static int
UTF8toUniversalString( char* octs, int len){
v->cai = NULL;
}
+int
+GEncComponentAny ( GenBuf *b, ComponentAny *in )
+{
+ if ( in->cai != NULL && in->cai->Encode != NULL )
+ return in->cai->Encode(b, &in->value );
+ else return (-1);
+}
+
int
BDecComponentAny ( void* mem_op, GenBuf *b, ComponentAny *result, AsnLen *bytesDecoded, int mode) {
ComponentAny *k, **k2;