⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loopback.c

📁 一个基于linux的TCP/IP协议栈的实现
💻 C
字号:
/* loopback.c * linqianghe@163.com * 2006-10-20 */#include "config.h"#include <sys/types.h>#include <sys/socket.h>#include <net/if_arp.h>#include <stdlib.h>#include <stdio.h>#include <errno.h>#include <ctype.h>#include <string.h>#include <unistd.h>#include "net-support.h"#include "pathnames.h"//#include "intl.h"#include "util.h"/* Display an UNSPEC address. */static char *pr_unspec(unsigned char *ptr){    static char buff[64];    char *pos;    unsigned int i;    pos = buff;    for (i = 0; i < sizeof(struct sockaddr); i++) {	pos += sprintf(pos, "%02X-", (*ptr++ & 0377));    }    buff[strlen(buff) - 1] = '\0';    return (buff);}struct hwtype unspec_hwtype ={    "unspec", NULL, /*"UNSPEC", */ -1, 0,    pr_unspec, NULL, NULL};struct hwtype loop_hwtype ={    "loop", NULL, /*"Local Loopback", */ ARPHRD_LOOPBACK, 0,    NULL, NULL, NULL};

⌨️ 快捷键说明

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