HP B2355-90138 manual LLA Example Program

Page 32

LLA and DLPI Example Programs

LLA Example Program

LLA Example Program

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

(C)COPYRIGHT HEWLETT-PACKARD COMPANY 1992. ALL RIGHTS RESERVED. NO PART OF THIS PROGRAM MAY BE PHOTOCOPIED, REPRODUCED, OR TRANSLATED TO ANOTHER PROGRAM LANGUAGE WITHOUT THE PRIOR WRITTEN CONSENT OF HEWLETT PACKARD COMPANY

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

/************************************************************************** The main part of this program is composed of two parts.

The first part demonstrates data transfer over LLA with LLC SAP headers. The second part of this program demonstrates data transfer over LLA with LLC SNAP headers.

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

#include <stdio.h> #include <fcntl.h> #include <memory.h> #include <errno.h> #include <sys/types.h> #include <sys/netio.h>

#define SEND_SAP

0x80

/* sending SAP */

#define RECV_SAP

0x82

/*

receiving SAP */

#define SNAP_SAP

0xAA

/*

SNAP SAP */

/************************************************************************* SNAP protocol values.

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

u_char SEND_SNAP_SAP[5] = {0x50, 0x00, 0x00, 0x00, 0x00}; u_char RECV_SNAP_SAP[5] = {0x60, 0x00, 0x00, 0x00, 0x00};

/************************************************************************* global areas for sending and receiving messages

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

#define MAX_PKT_SIZE

1500

/* Maximum packet size for Ethernet */

u_long

data_area[MAX_PKT_SIZE];

/* for data messages */

struct

fis ctrl_buf;

 

 

/************************************************************************* Read a packet on LLA file descriptor fd.

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

int

 

 

get_pkt(fd)

 

 

int

fd;

/* file descriptor */

{

 

 

int recv_cnt;

32

Chapter 2

Image 32
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