HP rp5430 HP DLPI Programmer's Guide - Page 188
case GET_MTU
View all HP rp5430 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 188 highlights
Sample Programs ioctl Example if (getmsg(fd, &ctlbuf, (struct strbuf*)NULL, &flags) < 0) perror("main: getmsg"); recv_primitive = *(int *)buf_ctl; /* If DL_OK_ACK is received, attach was successful */ if (recv_primitive != DL_OK_ACK) { printf("Could not attach\n"); exit(1); } /* See what user wanted us to do and call appropriate routine */ switch (operation) { case GET_MTU: get_mtu_size(fd); break; case SET_MTU: set_mtu_size(fd, set_mtu_value); break; default: printf("USAGE: %s [get_mtu | set_mtu ] PPA \n", argv[0]); } /* close & exit */ close(fd); } 188 Appendix A
Sample Programs
ioctl Example
Appendix A
188
if (getmsg(fd, &ctlbuf, (struct strbuf*)NULL, &flags) < 0)
perror("main:
getmsg");
recv_primitive = *(int *)buf_ctl;
/* If DL_OK_ACK is received, attach was successful */
if (recv_primitive != DL_OK_ACK) {
printf("Could not attach\n");
exit(1);
}
/* See what user wanted us to do and call appropriate routine */
switch (operation) {
case GET_MTU:
get_mtu_size(fd);
break;
case SET_MTU:
set_mtu_size(fd, set_mtu_value);
break;
default:
printf("USAGE: %s [get_mtu | set_mtu <MTU> ] PPA \n", argv[0]);
}
/* close & exit */
close(fd);
}