1 /* dtest.c - lber decoding test program */
3 * Copyright (c) 1990 Regents of the University of Michigan.
6 * Redistribution and use in source and binary forms are permitted
7 * provided that this notice is preserved and that due credit is given
8 * to the University of Michigan at Ann Arbor. The name of the University
9 * may not be used to endorse or promote products derived from this
10 * software without specific prior written permission. This software
11 * is provided ``as is'' without express or implied warranty.
14 #define DISABLE_BRIDGE
19 #include <ac/string.h>
24 #include <sys/types.h>
25 #include <sys/socket.h>
30 static usage( char *name )
32 fprintf( stderr, "usage: %s fmt\n", name );
35 main( int argc, char **argv )
50 bzero( &sb, sizeof(sb) );
52 sb.sb_ber.ber_buf = NULL;
53 if ( (tag = ber_get_next( &sb, &len, &ber )) == -1 ) {
54 perror( "ber_get_next" );
57 printf( "message has tag 0x%x and length %ld\n", tag, len );
59 if ( ber_scanf( &ber, "i", &i ) == -1 ) {
60 fprintf( stderr, "ber_scanf returns -1\n" );
63 printf( "got int %d\n", i );