![](/images/new-backgrounds/1319792/319792303x1.webp)
Sample Programs
Connection Mode
/* return the correlation number */
}
/************************************************************************** send a connect response with a specified correlation and token; wait for the OK_ACK
**************************************************************************/
void
connect_res(fd, correlation, token)
int | fd; | /* file descriptor */ |
u_long | correlation; | /* correlation number of CONNECT_IND */ |
|
| /* being responded to */ |
u_long | token; | /* token of stream to pass connection to */ |
{ |
|
|
dl_connect_res_t | *con_res = (dl_connect_res_t *)ctrl_area; |
/* fill in the connect response */
/* QOS is not supported; these fields must be set to zero */
put_ctrl(fd, sizeof(dl_connect_res_t), 0); get_msg(fd);
check_ctrl(DL_OK_ACK);
}
/************************************************************************** send a DISCONNECT_REQ and wait for the OK_ACK
**************************************************************************/
void |
|
|
disconnect_req(fd) |
| |
int | fd; | /* file descriptor */ |
{ |
|
|
dl_disconnect_req_t | *disc_req = (dl_disconnect_req_t *)ctrl_area; |
/* fill in the disconnect request */
Since we are not rejecting a CONNECT_IND, we set the correlation to zero.
152 | Appendix A |