lwip IP address handling 关于 IP 地址的 操作 API接口
lwip 2.0.3 IP address handling
/**
* @file
* IP address API (common IPv4 and IPv6)
*/
1、u32_t ipaddr_addr(const char *cp);
把一个 字符串的 IP 地址转换成 ip4_addr_t 类型的IP。
/**
* Ascii internet address interpretation routine.
* The value returned is in network order.
*
* @param cp IP address in ascii representation (e.g. "127.0.0.1")
* @return ip address in network order
*/
u32_t
ipaddr_addr(const char *cp)
{
ip4_addr_t val; if (ip4addr_aton(cp, &val)) {
return ip4_addr_get_u32(&val);
}
return (IPADDR_NONE);
}
2、char *ip4addr_ntoa(const ip4_addr_t *addr);
把一个 ip4_addr_t 类型 的IP地址 转换 成 字符串形式!
/**
* Convert numeric IP address into decimal dotted ASCII representation.
* returns ptr to static buffer; not reentrant!
*
* @param addr ip address in network order to convert
* @return pointer to a global static (!) buffer that holds the ASCII
* representation of addr
*/
char*
ip4addr_ntoa(const ip4_addr_t *addr)
{
static char str[IP4ADDR_STRLEN_MAX];
return ip4addr_ntoa_r(addr, str, IP4ADDR_STRLEN_MAX);
}
lwip IP address handling 关于 IP 地址的 操作 API接口的更多相关文章
- Azure China (8) 使用Azure PowerShell创建虚拟机,并设置固定Virtual IP Address和Private IP
<Windows Azure Platform 系列文章目录> 本文介绍的是由世纪互联运维的Windows Azure China. 相比于Global Azure (http://www ...
- ip address control获取ip字符串
1.环境:vs2010 & 默认项目字符集(貌似是unicode) 2.首先为ip address control添加control类型变量m_ipaddressedit, BYTE ips[ ...
- 取出ip address control的ip字符
1.给这个空间设置control型变量 m_add; 2.定义4个字节型变量,来获取控件中的4个ip字节 BYTE a,b,c,d: m_add.GetAddress(a,,b,c,d): 3.定义I ...
- 获得用户IP、城市、国家等信息的api接口
1 这个信息比较多 https://api.ipdata.co/?api-key=test <script> $.get("https://api.ipdata.co?api-k ...
- Windows Azure Cloud Service (44) 将Cloud Service加入Virtual Network Subnet,并固定Virtual IP Address(VIP)
<Windows Azure Platform 系列文章目录> 在之前的文章中,笔者已经详细介绍了如何将Virtual Machine加入Virtual Network,并且绑定固定的Pr ...
- Windows Azure Virtual Machine (28) 使用Azure实例级别IP,Instance-Level Public IP Address (PIP)
<Windows Azure Platform 系列文章目录> 本文介绍的是国内由世纪互联运维的Azure China 熟悉Azure平台的读者都知道,我们在使用Azure Virtual ...
- Windows Azure Virtual Network (6) 设置Azure Virtual Machine固定公网IP (Virtual IP Address, VIP) (1)
<Windows Azure Platform 系列文章目录> 注意:本文介绍的是Global Azure (http://www.windowsazure.com),如果你使用的是由世纪 ...
- TOJ4413: IP address
传送门:http://acm.tzc.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=4413 时间限制(普通/Java): ...
- [LeetCode] 1108. Defanging an IP Address
Description Given a valid (IPv4) IP address, return a defanged version of that IP address. A defange ...
随机推荐
- GoJs实现流程管理图
GoJS是一个实现交互类图表(比如流程图,树图,关系图,力导图等等)的JS库. 可以加入诸多功能.如流程判断,节点处理等等.GOJS在设计上极大的减轻了开发人员的开发成本.
- Java 之常用API(一)
常用API 1 API概述 2 Scanner类与String类 3 StringBuilder类 NO.one API概述 1.1 API概述 API(Application Programm ...
- bootstrap-table 分页增删改查之一(分页)
记录一下 bootstrap-table插件的使用 先看下效果图 首先是导入js <!--js jquery --> <script type="text/javascri ...
- group by 一条语句实现多条语句的效果
--一个sql 使用 group by 实现 4个 sql 的效果 select ProjectNumber,ClientName,jx,sf,sum(count) as TotalCount fro ...
- “小小科技女神”与微软DigiGirlz Day的约会
上周五在微软中国上海科技园举行的微软科技女生夏令营终于在一天“忙碌的轻松中”,伴随着师生和工程师们的欢笑结束了. 本次的微软科技女生夏令营一共有来自上海闵行区七宝中学.莘庄中学和闵行中学的共50名高中 ...
- 详解COM Add In的LoadBehavior及其妙用
Office的所有COM Add In,包括用Shared Add In模板和VSTO Add In模板创建的,都会在注册表里面存储一些信息. 对于当前用户安装的Add In,以Excel为例,对应 ...
- 原生ajax和jsonp
封装方法: function ajax(options) { options = options || {}; options.type = (options.type || "GET&qu ...
- openresty及lua的随机函数
我们都知道,所谓的随机都是伪随机,随机的结果是由随机算法和随机种子决定的. 所以,当我们没有初始化的时候,如果直接使用math.random(),那么出来的值肯定是每次都一样,因为种子等于0. 因此, ...
- August 25th 2017 Week 34th Friday
Stop to have a rest, do not forget others still in the running. 停下来休息的时候,不要忘记别人还在奔跑. You don't need ...
- 理解单链表的反转(java实现)
要求很简单,输入一个链表,反转链表后,输出新链表的表头. 反转链表是有2种方法(递归法,遍历法)实现的,面试官最爱考察的算法无非是斐波那契数列和单链表反转,递归方法实现链表反转比较优雅,但是对于不 ...