3 * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
4 * Use is subject to license terms.
8 #pragma ident "%Z%%M% %I% %E% SMI"
9 /* dtest.c - lber decoding test program */
11 * Copyright (c) 1990 Regents of the University of Michigan.
12 * All rights reserved.
14 * Redistribution and use in source and binary forms are permitted
15 * provided that this notice is preserved and that due credit is given
16 * to the University of Michigan at Ann Arbor. The name of the University
17 * may not be used to endorse or promote products derived from this
18 * software without specific prior written permission. This software
19 * is provided ``as is'' without express or implied warranty.
28 #include <sys/types.h>
29 #include <sys/socket.h>
33 static usage( char *name
)
35 fprintf( stderr
, "usage: %s fmt\n", name
);
38 main( int argc
, char **argv
)
53 bzero( &sb
, sizeof(sb
) );
55 sb
.sb_ber
.ber_buf
= NULL
;
56 if ( (tag
= ber_get_next( &sb
, &len
, &ber
)) == -1 ) {
57 perror( "ber_get_next" );
60 printf( "message has tag 0x%x and length %ld\n", tag
, len
);
62 if ( ber_scanf( &ber
, "i", &i
) == -1 ) {
63 fprintf( stderr
, "ber_scanf returns -1\n" );
66 printf( "got int %d\n", i
);