Sample Programs
Connectionless Mode
int | *dlsap_len; |
{ |
|
dl_subs_bind_req_t dl_subs_bind_ack_t u_char
*subs_bind_req = (dl_subs_bind_req_t*)ctrl_area; *subs_bind_ack = (dl_subs_bind_ack_t*)ctrl_area; *dlsap_addr;
/* Fill in Subsequent bind req */
/* send the SUBS_BIND_REQ and wait for the OK_ACK */ put_ctrl(fd, sizeof(dl_subs_bind_req_t)+snapsap_len, 0); get_msg(fd);
check_ctrl(DL_SUBS_BIND_ACK);
/* return the DLSAP to the caller */
*dlsap_len =
dlsap_addr = (u_char *)ctrl_area +
}
/************************************************************************** unbind, detach, and close
**************************************************************************/
void |
|
|
cleanup(fd) |
|
|
int | fd; | /* file descriptor */ |
{ |
|
|
dl_unbind_req_t *unbind_req = (dl_unbind_req_t *)ctrl_area; dl_detach_req_t *detach_req = (dl_detach_req_t *)ctrl_area;
/* unbind */
check_ctrl(DL_OK_ACK);
/* detach */
check_ctrl(DL_OK_ACK);
/* close */ close(fd);
}
/************************************************************************** receive a data packet;
**************************************************************************/
int |
|
|
recv_data(fd) |
|
|
int | fd; | /* file descriptor */ |
162 | Appendix A |