📄 siocsifname.c
字号:
/* SIOCSIFNAME.c * linqianghe@163.com * 2006-10-27 */#include "log.h"#include "SIOCSIFNAME.h"#include <sys/ioctl.h>#include <sys/socket.h>#include <linux/if.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <errno.h>void test_sifname( int sock_fd ){ struct ifreq ifr; PR_NOTICE( "test SIOCSIFNAME...\n" ); strcpy( ifr.ifr_name, "mylo" ); strcpy( ifr.ifr_newname, "mylo\%d" ); if( ioctl( sock_fd, SIOCSIFNAME, &ifr ) < 0 ) PR_ERR( "SIOCSIFNAME: %s\n", strerror(errno) ); else PR_NOTICE( "SIOCIFNAME successed!, new name is: %s\n", ifr.ifr_name );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -