HP rp2405 HP DLPI Programmer's Guide - Page 197
send the disconnect request, Since we are not rejecting a CONNECT_IND, we set the correlation
View all HP rp2405 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 197 highlights
Sample Programs Connection Mode Example send a DISCONNECT_REQ and wait for the OK_ACK void disconnect_req(fd) intfd;/* file descriptor */ { dl_disconnect_req_t*disc_req = (dl_disconnect_req_t *)ctrl_area; /* fill in the disconnect request */ disc_req->dl_primitive = DL_DISCONNECT_REQ; /* this is a normal disconnect */ disc_req->dl_reason = DL_DISC_NORMAL_CONDITION; /* Since we are not rejecting a CONNECT_IND, we set the correlation to zero. */ disc_req->dl_correlation = 0; /* send the disconnect request */ put_ctrl(fd, sizeof(dl_disconnect_req_t), 0); /* wait for the OK_ACK */ get_msg(fd); check_ctrl(DL_OK_ACK); } main main() { intsend_fd;/* file descriptor for sending stream */ intrecv_c_fd;/* fd for recv ctrl stream */ intrecv_d_fd;/* fd for recv data stream */ u_charsdlsap[20];/* sending DLSAP */ u_charrcdlsap[20];/* receiving control DLSAP */ u_charrddlsap[20];/* receiving data DLSAP */ intsdlsap_len, rcdlsap_len, rddlsap_len;/* DLSAP lengths */ u_longcorrelation;/* correlation number for CONNECT_IND */ u_longtoken;/* token for recv_d stream */ inti;/* loop counter */ /* We'll use three streams: a sending stream, a receiving stream bound with max_conind = 1 (the "control" stream), and a receiving stream Appendix A 197