![](/images/new-backgrounds/1319792/319792339x1.webp)
Sample Programs
Raw Mode
return(fd);
}
dl_bind(fd, sap, addr)
int fd, sap; u_char *addr;
{
dl_bind_req_t *bind_req = (dl_bind_req_t *)ctl_area; dl_bind_ack_t *bind_ack = (dl_bind_ack_t *)ctl_area;
put_ctrl(fd, sizeof(dl_bind_req_t), 0); get_msg(fd); check_ctrl(DL_BIND_ACK);
bcopy((u_char *)bind_ack +
}
void xxx();
void
main(argc, argv)
int argc;
char *argv[];
{
int infd, outfd; struct pollfd pinfo; int i, j, inseq; u_char addr[25];
struct ieee8023_hdr *mac_hdr = (struct ieee8023_hdr *)dat_area; struct ieee8022_hdr *llc_hdr;
dl_hp_rawdata_req_t *rawdat_req = (dl_hp_rawdata_req_t *)ctl_area; dl_hp_rawdata_ind_t *rawdat_ind = (dl_hp_rawdata_ind_t *)ctl_area; dl_error_ack_t *err_ack = (dl_error_ack_t *)ctl_area;
/* MAC header size is 14 bytes */
llc_hdr = (struct ieee8022_hdr *)&((u_char *)dat_area)[14];
if(!(infd = dl_open(PPA))) { printf(”error: open failed\n”); exit(1);
}
if(!(outfd = dl_open(PPA))) { printf(”error: open failed\n”); exit(1);
}
dl_bind(infd, INSAP, addr);
170 | Appendix A |