HP rp2450 HP DLPI Programmer's Guide - Page 184
Sample Programs, cmd_info.dl_request = DL_HP_DRV_MTU|DL_HP_SERIALIZE
View all HP rp2450 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 184 highlights
Sample Programs ioctl Example void set_mtu_size(fd, mtu) int fd; int mtu; { dl_hp_set_drv_param_ioctl_t cmd_info; struct strioctl strioctl; /* Zero out the cmd_info before filling it up with the IOCTL information. */ memset(&cmd_info, 0, sizeof(dl_hp_set_drv_param_ioctl_t)); /* Set the strioctl element to appropriate values. */ strioctl.ic_cmd = DL_HP_SET_DRV_PARAM_IOCTL; strioctl.ic_len = sizeof(cmd_info); strioctl.ic_timout = 0; strioctl.ic_dp = (char *)&cmd_info; cmd_info.dl_request = DL_HP_DRV_MTU|DL_HP_SERIALIZE; cmd_info.dl_mtu = mtu; /* Issue the ioctl request. */ if (ioctl(fd, I_STR, &strioctl) < 0) { /* Unable to get mtu size */ printf("Unable to get MTU size: errno = %d\n", errno); exit(-1); } printf("Successfully changed MTU to:%u\n", cmd_info.dl_mtu); } int main(argc, argv) int argc; char **argv; { int fd, flags, ppa = 0; int operation = 0, set_mtu_value = 0; int recv_primitive = 0; 184 Appendix A