if_nametoindex.c

来自「《unix网络编程第二卷》中的源代码」· C语言 代码 · 共 24 行

C
24
字号
#include	"unp.h"/* * This is a placeholder if the system does not provide this RFC 2133 * function.  If routing sockets with sysctl() are provided, then the * if_XXX() functions in the libroute/ directory will replace these. */unsigned intif_nametoindex(const char *name){	return(0);}unsigned intIf_nametoindex(const char *name){	int		index;	if ( (index = if_nametoindex(name)) == 0)		err_quit("if_nametoindex error for %s", name);	return(index);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?