HP rp5400 HP DLPI Programmer's Guide - Page 196
fill in the connect response, con_res->dl_primitive = DL_CONNECT_RES
View all HP rp5400 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 196 highlights
Sample Programs Connection Mode Example connect_ind(fd) intfd;/* file descriptor */ { dl_connect_ind_t*con_ind = (dl_connect_ind_t *)ctrl_area; u_char*dlsap; intdlsap_len; /* wait for the connect indication */ get_msg(fd); check_ctrl(DL_CONNECT_IND); /* print the calling DLSAP */ dlsap = (u_char *)ctrl_area + con_ind->dl_calling_addr_offset; dlsap_len = con_ind->dl_calling_addr_length; print_dlsap("received CONNECT_IND from DLSAP ", dlsap, dlsap_len); /* return the correlation number */ return(con_ind->dl_correlation); } send a connect response with a specified correlation and token; wait for the OK_ACK void connect_res(fd, correlation, token) intfd;/* file descriptor */ u_longcorrelation;/* correlation number of CONNECT_IND */ /* being responded to */ u_longtoken;/* token of stream to pass connection to */ { dl_connect_res_t*con_res = (dl_connect_res_t *)ctrl_area; /* fill in the connect response */ con_res->dl_primitive = DL_CONNECT_RES; con_res->dl_correlation = correlation; con_res->dl_resp_token = token; /* QOS is not supported; these fields must be set to zero */ con_res->dl_qos_length = 0; con_res->dl_qos_offset = 0; con_res->dl_growth = 0; put_ctrl(fd, sizeof(dl_connect_res_t), 0); get_msg(fd); check_ctrl(DL_OK_ACK); } 196 Appendix A