HP Rp7410 HP DLPI Programmer's Guide - Page 212
subs_bindsend_fd, SEND_SNAP_SAP
View all HP Rp7410 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 212 highlights
Sample Programs Connectionless Mode Example cleanup(send_fd); cleanup(recv_fd); /* PART 2 of program. Demonstrate connectionless data transfer with LLC SNAP SAP header. */ /* As demonstrated in the first part of this program we must first open the DLPI device file, /dev/dlpi, and attach to a PPA. */ send_fd = attach(); recv_fd = attach(); /* The first method for binding a SNAP protocol value (which is demonstrated below) requires the user to first bind the SNAP SAP 0xAA, then issue a subsequent bind with class DL_HIERARCHICAL_BIND with the 5 bytes of SNAP information. The second method (which is not demonstrated in this program) is to bind any supported protocol value (see section 5) and then issue a subsequent bind with class DL_PEER_BIND. The data area of the subsequent bind should include 6 bytes of data, the first byte being the SNAP SAP 0xAA followed by 5 bytes of SNAP information. */ bind(send_fd, SNAP_SAP, 0, DL_CLDLS, sdlsap, &sdlsap_len); bind(recv_fd, SNAP_SAP, 0, DL_CLDLS, rdlsap, &rdlsap_len); /* Now we must complete the binding of the SNAP protocol value with the subsequent bind request and a subsequent bind class of DL_HIERARCHICAL_BIND. */ subs_bind(send_fd, SEND_SNAP_SAP, 5, DL_HIERARCHICAL_BIND, sdlsap, &sdlsap_len); subs_bind(recv_fd, RECV_SNAP_SAP, 5, DL_HIERARCHICAL_BIND, rdlsap, &rdlsap_len); /* print the DLSAPs we got back from the binds */ print_dlsap("sending DLSAP = ", sdlsap, sdlsap_len); print_dlsap("receiving DLSAP = ", rdlsap, rdlsap_len); /* Time to send some data. We'll send 5 data packets in sequence. */ 212 Appendix A