HP UX 11i v2 Networking Software manual Raw Mode

Page 167

Sample Programs

Raw Mode

Raw Mode

/*

*(C) COPYRIGHT HEWLETT-PACKARD COMPANY 1993. 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 program demonstrates RAW mode data transfer over an

802.3interface.

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

#define PPA 1

#define FRAME_LEN 1500 /* max message size is 1514;MAC+LLC+data */ #define SEQ_OFFSET 100

#define INSAP 22 #define OUTSAP 24

#define OUTER_LOOPS 10 #define INNER_LOOPS 25

#include <sys/types.h> #include <fcntl.h> #include <errno.h> #include <stdio.h> #include <string.h> #include <signal.h> #include <math.h> #include <ctype.h>

#include <sys/stream.h> #include <sys/stropts.h> #include <sys/poll.h> #include <sys/dlpi.h> #include <sys/dlpi_ext.h> #include <netinet/if_ieee.h>

#define bcopy(source, destination, length) memcpy(destination, source, length) #define ETHER_HLEN 14

char tag[80];

#define AREA_SZ 5000 /*-=-* buffer length in bytes *-=-*/

u_long ctl_area[AREA_SZ]; u_long dat_area[AREA_SZ];

struct strbuf ctl = {AREA_SZ, 0, ctl_area}; struct strbuf dat = {AREA_SZ, 0, dat_area};

#define GOT_CTRL

1

Appendix A

167

Image 167
Contents Edition Dlpi Programmer’s GuideLegal Notices Page Page Contents Contents Contents Sample Programs Printing History Page Appendix a Sample Programs PrefacePage Introduction to Dlpi Introduction to Dlpi HP Dlpi Features Header Files Device File FormatData Link Layer Service InterfaceDlpi Modes of Communication Connection-mode ServiceData Link Layer Physical Attachment Identification Connectionless-mode ServiceDlpi Addressing HP PPA Format HP’s Dlsap Address Format 802.3, Ethernet, Token Ring, Fddi Data Link User IdentificationHP’s Dlsap Address Format for Fibre Channel Dlsap Promiscuous Mode Clarifications Dlpi Services Dlhpppareq DlerrorackDlinforeq DlinfoackDlresetcon DlresetreqDlresetind DlresetresDlhprawdataind Local Management ServicesInformation Reporting Service DlhprawdatareqBind Service Attach ServiceSnap BindingReserved IEEESAPS/Ethertypes Message Flow Binding a Stream to a Dlsap Message Flow Enabling a Specific Multicast Address on a Connection Establishment Service Connection-mode Services12 Message Flow Successful Connection Establishment Connection Handoff13 Message Flow Token Retrieval 16 Message Flow Both Primitives are Destroyed by Provider 19 Message Flow Normal Data Transfer Data Transfer Service20 Message Flow DLS User-Invoked Connection Release Connection Release ServiceReset Service 23 Message Flow DLS User-Invoked Connection Reset Connectionless Data Transfer Connectionless-mode ServicesError Reporting Service Raw-mode ServicesRaw-mode Data Transfer XID and Test ServiceXID and Test Packet Handling 31 Message Flow XID ServiceAn Example 32 Message Flow Test Service33 Message Flow a Connection-Mode Example Dlpi Primitives Dlpi Primitives PPA Initialization/De-initialization Local Management PrimitivesDlhpppareq Dlhpppaack Dlhpppaack MTU DlinforeqDlinfoack Dlmetro DlcsmacdDltpb DltprDlother DlcharDlctca DlfddiDlunknown DlhprawdlsDlacldls DLSTYLE2 DLSTYLE1Dlbadppa DlaccessDlattachreq Dlsyserr DldetachreqDloutstate Dlbindreq Dlnotinit DlbadaddrDlinitfailed Dlbindack Dlunbindreq Dlsubsbindreq Dlhierarchicalbind DlpeerbindDltoomany DlsubsbindackDlsubsunbindreq Dlenabmultireq Dlnotsupported DldisabmultireqDlnotenab DlpromisconreqDlpromiscmulti DlpromiscphysDlpromiscsap Dlpromiscoffreq Dlokack Dlerrorack Dlphysaddrreq Dlfactphysaddr Dlcurrphysaddr Dlphysaddrreq DlphysaddrackDlsetphysaddrreq DlphysaddrackDlsetphysaddrreq Dlgetstatisticsreq DlgetstatisticsreqDlgetstatisticsack DlbusyDlgetstatisticsack DlhpmulticastlistreqDlhpmulticastlistack Dlhpmulticastlistack Dlunitdatareq Connectionless-mode Service PrimitivesDlbaddata Dlunitdataind Dluderrorind Message is valid in state Dlidle Dlhprawdatareq Raw Mode Service PrimitivesDlbadprim DlhprawdataindRaw Mode Service Primitives Dlhpinforeq Connection-mode Service PrimitivesConnection-Oriented Dlpi Extensions Dlhpinforeq DlhpinfoackDlhpinfoack Connection-mode Service Primitives Connection-mode Service Primitives Dlhpsetacktoreq DlhpsetacktoreqDlhpsetptoreq DlhpsetptoreqDlhpsetrejtoreq DlhpsetrejtoreqDlhpsetbusytoreq Dlhpsetbusytoreq DlhpsetsendacktoreqDlhpsetmaxretriesreq DlhpsetmaxretriesreqDlhpsetsendacktoreq DLOUTCONPENDING, Dlinconpending DlhpsetackthreshreqDlhpsetlocalwinreq Dlhpsetremotewinreq Dlhpsetremotewinreq DlhpclearstatsreqDlhpsetlocalbusyreq DlhpsetlocalbusyreqDlhpclearstatsreq Dlhpclearlocalbusyreq DlhpclearlocalbusyreqDlconnectreq Dlbadqostype DlconnectindDlbadqosparam 112 Dlconnectres 114 Dlpending DlconnectconDlbadtoken Dlbadcorr116 Dltokenack DltokenreqDldatareq Dldisconnectreq Dldataind120 Dldisconnectind Dlresetreq Dlresetind Dlresetres Dlresetcon 126 Dltestreq Primitives to Handle XID and Test OperationsDltestauto DltestindChapter 129 Dltestres Dltestcon Dlxidreq Dlxidauto Dlxidind134 Dlpollfinal DlxidresDlxidcon Chapter 137 Dlpi States Udqos Pend Dludqos User Reset DluserresetDlresetcon Prov Reset Dlprovreset Dlresetres ResetresDLDISCON11 DLDISCON9Pend Pending DlinconpendingChapter 141 142 Sample Programs Longareasize Connection ModeAppendix a 145 146 Appendix a 147 148 Appendix a 149 150 Appendix a 151 152 Appendix a 153 154 Appendix a 155 Snap SAP Connectionless ModeAppendix a 157 158 Appendix a 159 160 Appendix a 161 162 Appendix a 163 164 Appendix a 165 166 Raw Mode 168 Appendix a 169 170 Appendix a 171 Raw Mode 172 Connection establishment Glossary174 Glossary Index
Related manuals
Manual 94 pages 16.8 Kb Manual 74 pages 39 Kb Manual 236 pages 18.16 Kb Manual 12 pages 39.66 Kb Manual 28 pages 49.76 Kb