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

📄 utils.h

📁 Adhoc无线网络路由协议源码
💻 H
字号:
/* Some utility functions borrowed from utils.c of  NIST's kernel-AODV* implementation by Luke Klein-Berndt.*/#ifndef UTIL_H#define UTIL_H#include <time.h>#include <sys/time.h>#include <sys/types.h>/* * *   Gets the current time in milliseconds since 1 jan 1970 * *   Return: *     u_int64_t - On error -1 is returned otherwise the time. */u_int64_t getcurrtime();/* *  dot_ip() : converts ip address from int to dot.dot notation. *  is a wrapper around inet_ntoa so that you do not have to declare a, in_addr structure  *   *	 dot_ip can be called only once in one statement. *	 this is because dot_ip uses inet_ntoa which returns in a statically  *	 allocated buffer which is overwritten in each call. * hence you have to break up the printfs if there are multiple calls to dot_ip **/char *dot_ip(u_int32_t ipint);/* This is a routine to do a 'mknod' on the /dev/tun<n> if possible: * Return: 0 is ok, -1=already open, etc. *  */int mk_node(char *devname, int major, int minor);#endif 

⌨️ 快捷键说明

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