Back to index

lightning-sunbird  0.9+nobinonly
Functions
dtest.c File Reference
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "lber.h"

Go to the source code of this file.

Functions

int SSL_Recv (int s, char *b, unsigned l, int dummy)
 SSL_Send (int s, char *b, unsigned l, int dummy)
static void usage (char *name)
 main (int argc, char **argv)

Function Documentation

main ( int  argc,
char **  argv 
)

Definition at line 82 of file dtest.c.

{
       long          i, fd;
       unsigned long len;
       int           tag;
       BerElement    *ber;
       Sockbuf              *sb;
       extern int    lber_debug;

       lber_debug = 255;
       if ( argc > 1 ) {
              usage( argv[0] );
              exit( 1 );
       }

       sb = ber_sockbuf_alloc();
       fd = 0;
       ber_sockbuf_set_option( sb, LBER_SOCKBUF_OPT_DESC, &fd );

       if ( (ber = der_alloc()) == NULL ) {
              perror( "ber_alloc" );
              exit( 1 );
       }

       if ( (tag = ber_get_next( sb, &len, ber )) == LBER_ERROR ) {
              perror( "ber_get_next" );
              exit( 1 );
       }
       printf( "message has tag 0x%x and length %ld\n", tag, len );

       return( 0 );
}

Here is the call graph for this function:

int SSL_Recv ( int  s,
char *  b,
unsigned  l,
int  dummy 
)

Definition at line 67 of file dtest.c.

{
       return( read( s, b, l ) );
}
SSL_Send ( int  s,
char *  b,
unsigned  l,
int  dummy 
)

Definition at line 72 of file dtest.c.

{
       return( write( s, b, l ) );
}
static void usage ( char *  name) [static]

Definition at line 77 of file dtest.c.

{
       fprintf( stderr, "usage: %s < berfile\n", name );
}

Here is the call graph for this function: