HP rp5450 HP DLPI Programmer's Guide - Page 183
ioctl Example, Appendix A, Sample Programs
View all HP rp5450 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 183 highlights
Sample Programs ioctl Example user has passed as a parameter. This routine issues the ioctl to get the MTU of the interface that user has requested void get_mtu_size(fd) int fd; { dl_hp_get_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_get_drv_param_ioctl_t)); /* Set the strioctl element to appropriate values. */ strioctl.ic_cmd = DL_HP_GET_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; /* Issue the ioctl request. */ if (ioctl(fd, I_STR, &strioctl) < 0) { /* There was a error processing this ioctl */ printf("Unable to get MTU size: errno = %d\n", errno); exit(-1); } printf("Current MTU is:%u\n", cmd_info.dl_mtu Routine that will issue a DL_HP_SET_DRV_PARAM_IOCTL to the PPA that user has passed as a parameter. This routine issues the ioctl to set the MTU of the interface to the user specified value Appendix A 183