HP rp5400 HP DLPI Programmer's Guide - Page 198
connect_reqsend_fd, rcdlsap, rcdlsap_len, The receiver control stream gets a CONNECT_IND.
View all HP rp5400 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 198 highlights
Sample Programs Connection Mode Example bound with max_conind = 0 (the "data" stream). The connect indication will be handed off from the control stream to the data stream. We initially open only the sending stream and the receiving control stream. */ /* First, we must open the DLPI device file, /dev/dlpi, and attach to a PPA. attach will open /dev/dlpi, find the first PPA with the DL_HP_PPA_INFO primitive, and attach to that PPA. attach() returns the file descriptor for the stream. */ send_fd = attach(); recv_c_fd = attach(); /* Now we must bind the streams to saps. The bind function will return the local DLSAP and its length for each stream in the last two arguments. Only the receiving control stream has a non-zero max_conind. */ bind(send_fd, SEND_SAP, 0, DL_CODLS, sdlsap, &sdlsap_len); bind(recv_c_fd, RECV_SAP, 1, DL_CODLS, rcdlsap, &rcdlsap_len); /* Start the connection establishment process by sending a CONNECT_REQ from the sender to the receiver control stream. */ connect_req(send_fd, rcdlsap, rcdlsap_len); /* The receiver control stream gets a CONNECT_IND. We need the correlation number to relate the CONNECT_IND to the CONNECT_RES we will send down later. */ correlation = connect_ind(recv_c_fd); /* We want to handle the actual data transfer over a dedicated receiver stream. Here, we attach and bind a second stream on the receivers sap with max_conind = 0. */ recv_d_fd = attach(); bind(recv_d_fd, RECV_SAP, 0, DL_CODLS, rddlsap, &rddlsap_len); /* 198 Appendix A