HP B2355-90138 manual LLA Example Program

Page 36
/* file descriptor */

LLA and DLPI Example Programs

LLA Example Program

/**************************************************************************** Close the file descriptor. This will automatically unbind the protocol.

****************************************************************************/

void cleanup(fd)

int fd;

{

/* close */ close(fd);

}

/**************************************************************************** receive a data packet;

****************************************************************************/

int

 

 

recv_data(fd)

 

 

int

fd;

/* file descriptor */

{

 

 

int

length;

 

length = get_pkt(fd);

if(length == 0)

{

printf(”error: did not receive any data part \n”); exit(1);

}

return(length);

}

/**************************************************************************** send a data packet; assumes data_area has already been filled in

and a destination address has already been logged.

****************************************************************************/

void

 

 

send_data(fd, len)

 

int

fd;

/* file descriptor */

int

len;

/* length of the packet to send */

{

 

 

put_data(fd, len);

}

/**************************************************************************** print a string followed by a destination MAC and SAP address.

****************************************************************************/

void

print_dest_addr(string, dest_addr, dest_addr_len)

char

*string;

/*

label */

u_char

*dest_addr;

/*

the destination address */

36

Chapter 2

Image 36
Contents LLA to Dlpi Migration Guide Legal Notices Page Page Contents Contents Printing History Page Preface Page LLA to Dlpi Migration LLA to Dlpi Migration Device Files Ioctl Requests LLA ioctl req type Dlpi PrimitiveLogreadtimeout Transmitting Data Receiving Data Receiving Data LLA and Dlpi Example LLA and Dlpi Example Programs Dlpi Example Program Snap SAPStruct strbuf databuf = Dlpi Example Program Dlpi Example Program Dlpi Example Program Dlpi Example Program Dlpi Example Program Dlpi Example Program Dlpi Example Program Dlpi Example Program Dlpi Example Program LLA Example Program LLA Example Program LLA Example Program LLA Example Program LLA Example Program LLA Example Program LLA Example Program LLA Example Program LLA Example Program Index