Lines Matching refs:ber

66 ber_put_tag( BerElement	*ber, ber_tag_t tag, int nosos )  in ber_put_tag()  argument
75 return( ber_write( ber, ((char *) &ntag) + sizeof(ber_int_t) - taglen, in ber_put_tag()
106 ber_put_len( BerElement *ber, ber_len_t len, int nosos ) in ber_put_len() argument
120 return( ber_write( ber, (char *) &netlen + sizeof(ber_int_t) - 1, in ber_put_len()
142 if ( ber_write( ber, &lenlen, 1, nosos ) != 1 ) in ber_put_len()
147 if ( ber_write( ber, (char *) &netlen + (sizeof(ber_int_t) - i), i, nosos ) in ber_put_len()
155 ber_put_int_or_enum( BerElement *ber, ber_int_t num, ber_tag_t tag ) in ber_put_int_or_enum() argument
191 if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 ) in ber_put_int_or_enum()
194 if ( (lenlen = ber_put_len( ber, len, 0 )) == -1 ) in ber_put_int_or_enum()
198 if ( ber_write( ber, (char *) &netnum + (sizeof(ber_int_t) - i), i, 0 ) in ber_put_int_or_enum()
208 ber_put_enum( BerElement *ber, ber_int_t num, ber_tag_t tag ) in ber_put_enum() argument
213 return( ber_put_int_or_enum( ber, num, tag ) ); in ber_put_enum()
218 ber_put_int( BerElement *ber, ber_int_t num, ber_tag_t tag ) in ber_put_int() argument
223 return( ber_put_int_or_enum( ber, num, tag ) ); in ber_put_int()
228 ber_put_ostring( BerElement *ber, char *str, ber_len_t len, in ber_put_ostring() argument
239 if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 ) in ber_put_ostring()
243 if ( len > 0 && ( ber->ber_options & LBER_OPT_TRANSLATE_STRINGS ) != 0 in ber_put_ostring()
244 && ber->ber_encode_translate_proc != NULL ) { in ber_put_ostring()
245 if ( (*(ber->ber_encode_translate_proc))( &str, &len, 0 ) in ber_put_ostring()
260 if ( (lenlen = ber_put_len( ber, len, 0 )) == -1 || in ber_put_ostring()
261 ber_write( ber, str, len, 0 ) != (ber_int_t) len ) { in ber_put_ostring()
279 ber_put_string( BerElement *ber, char *str, ber_tag_t tag ) in ber_put_string() argument
281 return( ber_put_ostring( ber, str, (ber_len_t) strlen( str ), tag )); in ber_put_string()
286 ber_put_bitstring( BerElement *ber, char *str, in ber_put_bitstring() argument
295 if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 ) in ber_put_bitstring()
300 if ( (lenlen = ber_put_len( ber, len + 1, 0 )) == -1 ) in ber_put_bitstring()
303 if ( ber_write( ber, (char *)&unusedbits, 1, 0 ) != 1 ) in ber_put_bitstring()
306 if ( ber_write( ber, str, len, 0 ) != len ) in ber_put_bitstring()
315 ber_put_null( BerElement *ber, ber_tag_t tag ) in ber_put_null() argument
322 if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 ) in ber_put_null()
325 if ( ber_put_len( ber, 0, 0 ) != 1 ) in ber_put_null()
333 ber_put_boolean( BerElement *ber, int boolval, ber_tag_t tag ) in ber_put_boolean() argument
342 if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 ) in ber_put_boolean()
345 if ( ber_put_len( ber, 1, 0 ) != 1 ) in ber_put_boolean()
348 if ( ber_write( ber, (char *)(boolval ? &trueval : &falseval), 1, 0 ) in ber_put_boolean()
367 ber_start_seqorset( BerElement *ber, ber_tag_t tag ) in ber_start_seqorset() argument
372 if (ber->ber_sos_stack_posn < SOS_STACK_SIZE) { in ber_start_seqorset()
374 new_sos = &ber->ber_sos_stack[ber->ber_sos_stack_posn]; in ber_start_seqorset()
382 ber->ber_sos_stack_posn++; in ber_start_seqorset()
384 if ( ber->ber_sos == NULLSEQORSET ) in ber_start_seqorset()
385 new_sos->sos_first = ber->ber_ptr; in ber_start_seqorset()
387 new_sos->sos_first = ber->ber_sos->sos_ptr; in ber_start_seqorset()
393 new_sos->sos_next = ber->ber_sos; in ber_start_seqorset()
396 ber->ber_sos = new_sos; in ber_start_seqorset()
397 if (ber->ber_sos->sos_ptr > ber->ber_end) { in ber_start_seqorset()
398 nslberi_ber_realloc(ber, ber->ber_sos->sos_ptr - ber->ber_end); in ber_start_seqorset()
405 ber_start_seq( BerElement *ber, ber_tag_t tag ) in ber_start_seq() argument
410 return( ber_start_seqorset( ber, tag ) ); in ber_start_seq()
415 ber_start_set( BerElement *ber, ber_tag_t tag ) in ber_start_set() argument
420 return( ber_start_seqorset( ber, tag ) ); in ber_start_set()
424 ber_put_seqorset( BerElement *ber ) in ber_put_seqorset() argument
430 Seqorset **sos = &ber->ber_sos; in ber_put_seqorset()
445 if ( ber->ber_options & LBER_OPT_USE_DER ) { in ber_put_seqorset()
453 if ( (taglen = ber_put_tag( ber, (*sos)->sos_tag, 1 )) == -1 ) in ber_put_seqorset()
456 if ( ber->ber_options & LBER_OPT_USE_DER ) { in ber_put_seqorset()
458 if ( ber_put_len( ber, len, 1 ) == -1 ) in ber_put_seqorset()
474 if ( ber_write( ber, (char *)&ltag, 1, 1 ) != 1 ) in ber_put_seqorset()
478 if ( ber_write( ber, (char *) &netlen + sizeof(ber_int_t) in ber_put_seqorset()
484 ber->ber_ptr += len; in ber_put_seqorset()
494 if ( ber->ber_options & LBER_OPT_USE_DER ) { in ber_put_seqorset()
502 if ( ber->ber_options & LBER_OPT_USE_DER ) { in ber_put_seqorset()
533 if (ber->ber_sos_stack_posn <= SOS_STACK_SIZE) { in ber_put_seqorset()
539 ber->ber_sos_stack_posn--; in ber_put_seqorset()
547 ber_put_seq( BerElement *ber ) in ber_put_seq() argument
549 return( ber_put_seqorset( ber ) ); in ber_put_seq()
554 ber_put_set( BerElement *ber ) in ber_put_set() argument
556 return( ber_put_seqorset( ber ) ); in ber_put_set()
562 ber_printf( BerElement *ber, const char *fmt, ... ) in ber_printf() argument
584 rc = ber_put_boolean( ber, i, ber->ber_tag ); in ber_printf()
589 rc = ber_put_int( ber, (ber_int_t)i, ber->ber_tag ); in ber_printf()
594 rc = ber_put_enum( ber, (ber_int_t)i, ber->ber_tag ); in ber_printf()
598 rc = ber_put_null( ber, ber->ber_tag ); in ber_printf()
604 rc = ber_put_ostring( ber, s, len, ber->ber_tag ); in ber_printf()
611 rc = ber_put_ostring( ber, "", 0, ber->ber_tag ); in ber_printf()
613 rc = ber_put_ostring( ber, bval->bv_val, bval->bv_len, in ber_printf()
614 ber->ber_tag ); in ber_printf()
620 rc = ber_put_string( ber, s, ber->ber_tag ); in ber_printf()
626 rc = ber_put_bitstring( ber, s, len, ber->ber_tag ); in ber_printf()
630 ber->ber_tag = va_arg( ap, ber_tag_t ); in ber_printf()
631 ber->ber_usertag = 1; in ber_printf()
638 if ( (rc = ber_put_string( ber, ss[i], in ber_printf()
639 ber->ber_tag )) == -1 ) in ber_printf()
648 if ( (rc = ber_put_ostring( ber, bv[i]->bv_val, in ber_printf()
649 bv[i]->bv_len, ber->ber_tag )) == -1 ) in ber_printf()
655 rc = ber_start_seq( ber, ber->ber_tag ); in ber_printf()
659 rc = ber_put_seqorset( ber ); in ber_printf()
663 rc = ber_start_set( ber, ber->ber_tag ); in ber_printf()
667 rc = ber_put_seqorset( ber ); in ber_printf()
679 if ( ber->ber_usertag == 0 ) in ber_printf()
680 ber->ber_tag = LBER_DEFAULT; in ber_printf()
682 ber->ber_usertag = 0; in ber_printf()