windows_extra.c

来自「mobile ip 在linux下的一种实现」· C语言 代码 · 共 34 行

C
34
字号
/* $Id: windows_extra.c,v 1.2 2000/11/17 22:51:37 jm Exp $ * Low level functions for not included features for Windows (cygwin32) * * Dynamic hierarchial IP tunnel * Copyright (C) 2000, Dynamics group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. See README and COPYING for * more details. */#include "config.h"#ifdef DYN_TARGET_WINDOWS#include <stdio.h>#include <netinet/in.h>/* FIX: for some reason inet_aton() was not available in cygwin's libraries, so * it is define here; this may need to be removed if the function is added to * the libraries.. */int inet_aton(const char *cp, struct in_addr *inp){	int a1, a2, a3, a4;	a1 = a2 = a3 = a4 = 0;	if (sscanf(cp, "%d.%d.%d.%d", &a1, &a2, &a3, &a4) != 4)		return 0;	inp->s_addr = htonl((a1 << 24) | (a2 << 16) | (a3 << 8) | a4);	return 1;}#endif /* DYN_TARGET_WINDOWS */

⌨️ 快捷键说明

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