HP rp5430 HP DLPI Programmer's Guide - Page 197
Note that unlike most of the other, messages this one is a PCPROTO message so we call put_ctrl
View all HP rp5430 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 197 highlights
Sample Programs Connection Mode Example con_req->dl_dest_addr_length = dlsap_len; con_req->dl_dest_addr_offset = sizeof(dl_connect_req_t); /* QOS is not supported; these fields must be set to zero */ con_req->dl_qos_length = 0; con_req->dl_qos_offset = 0; con_req->dl_growth = 0; /* copy in the dlsap */ tdlsap = (u_char *)ctrl_area + con_req->dl_dest_addr_offset; memcpy(tdlsap, dlsap, dlsap_len); /* send the connect request */ print_dlsap("sending CONNECT_REQ to DLSAP ", dlsap, dlsap_len); put_ctrl(fd, sizeof(dl_connect_req_t) + dlsap_len, 0); } get a connection response token for a stream; returns the token u_long get_token(fd) intfd;/* file descriptor */ { dl_token_req_t*tok_req = (dl_token_req_t *)ctrl_area; dl_token_ack_t*tok_ack = (dl_token_ack_t *)ctrl_area; /* Send down a token request. Note that unlike most of the other messages this one is a PCPROTO message so we call put_ctrl with RS_HIPRI instead of zero. */ tok_req->dl_primitive = DL_TOKEN_REQ; put_ctrl(fd, sizeof(dl_token_req_t), RS_HIPRI); /* wait for the token ack */ get_msg(fd); check_ctrl(DL_TOKEN_ACK); /* return the token */ return(tok_ack->dl_token); } get a connect indication from a stream; returns the correlation number u_long Appendix A 197