Sample Programs
Raw Mode
dl_bind(outfd, OUTSAP, addr);
pinfo.fd = outfd;
pinfo.events = POLLIN POLLPRI; pinfo.revents = 0;
for(i = 0; i < OUTER_LOOPS; i++) { for(j = 0; j < INNER_LOOPS; j++) {
bcopy(addr,
*The ieee header length does not include the
*ethernet MAC header.
*/
sprintf(&dat_area[SEQ_OFFSET], ”%d”, i * INNER_LOOPS + j);
fflush(stdout); if(poll(&pinfo, 1, 0)) {
get_msg(outfd);
check_ctrl(DL_ERROR_ACK);
check_ctrl(0); } else {
/*
}
}
}
for(j = 0; j < INNER_LOOPS; j++) { get_msg(infd);
printf(”\nlength error: expected %d, got %d\n”, FRAME_LEN, dat.len);
}
inseq = strtol(&dat_area[SEQ_OFFSET], 0, 0); if(inseq != (i * INNER_LOOPS + j)) {
printf(”\nseq error: expected %d, got %d\n”, i * INNER_LOOPS + j, inseq);
}
}
}
printf(”\n”);
}
Appendix A | 171 |