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接口的更多相关文章

  1. Azure China (8) 使用Azure PowerShell创建虚拟机,并设置固定Virtual IP Address和Private IP

    <Windows Azure Platform 系列文章目录> 本文介绍的是由世纪互联运维的Windows Azure China. 相比于Global Azure (http://www ...

  2. ip address control获取ip字符串

    1.环境:vs2010 & 默认项目字符集(貌似是unicode) 2.首先为ip address control添加control类型变量m_ipaddressedit, BYTE ips[ ...

  3. 取出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 ...

  4. 获得用户IP、城市、国家等信息的api接口

    1 这个信息比较多 https://api.ipdata.co/?api-key=test <script> $.get("https://api.ipdata.co?api-k ...

  5. Windows Azure Cloud Service (44) 将Cloud Service加入Virtual Network Subnet,并固定Virtual IP Address(VIP)

    <Windows Azure Platform 系列文章目录> 在之前的文章中,笔者已经详细介绍了如何将Virtual Machine加入Virtual Network,并且绑定固定的Pr ...

  6. Windows Azure Virtual Machine (28) 使用Azure实例级别IP,Instance-Level Public IP Address (PIP)

    <Windows Azure Platform 系列文章目录> 本文介绍的是国内由世纪互联运维的Azure China 熟悉Azure平台的读者都知道,我们在使用Azure Virtual ...

  7. Windows Azure Virtual Network (6) 设置Azure Virtual Machine固定公网IP (Virtual IP Address, VIP) (1)

    <Windows Azure Platform 系列文章目录> 注意:本文介绍的是Global Azure (http://www.windowsazure.com),如果你使用的是由世纪 ...

  8. TOJ4413: IP address

    传送门:http://acm.tzc.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=4413 时间限制(普通/Java): ...

  9. [LeetCode] 1108. Defanging an IP Address

    Description Given a valid (IPv4) IP address, return a defanged version of that IP address. A defange ...

随机推荐

  1. 您只能在 HTML 输出流中使用 document.write,啥意思

    JavaScript :写入到HTML输出语法 注意:只能在HTML输出中使用,如果在文档已经加载后使用(比如在函数中)  会覆盖到整个文档 <!DOCTYPE html> <htm ...

  2. Bootstrap框架和inconfont、font-awesome使用

    iconfont的使用:https://www.cnblogs.com/clschao/articles/10387580.html Bootstrap介绍 Bootstrap是Twitter开源的基 ...

  3. 解决react不能往setState中传key作为参数的办法(文章最后实现了传递key做参数的办法)

    读者朋友可以直接看最后一个分割线下面的那部分!利用方括号语法来动态的访问对象的属性,实现当参数为属性名的传递; 有时候我们需要每次单独设置众多state中的一个,但是,都是进行相同的操作,这时候如果每 ...

  4. 爬虫必备—requests

    Requests 是使用 Apache2 Licensed 许可证的 基于Python开发的HTTP 库,其在Python内置模块的基础上进行了高度的封装,从而使得Pythoner进行网络请求时,变得 ...

  5. hololens DEP2220: 无法删除目标计算机“127.0.0.1”上的文件夹

    Hololens开发调试的过程中,可能会出现 “DEP2220: 无法删除目标计算机“127.0.0.1”上的文件夹“ 的错误导致无法部署,解决办法是进入项目属性页——调试——启动选项,勾选“卸载并重 ...

  6. VS2008和VC6.0下使用pthread.h头文件

    原文:http://www.cppblog.com/liquidx/archive/2009/06/16/87811.html 要在windows环境下使用 #include <pthread. ...

  7. Python爬虫教程-05-python爬虫实现百度翻译

    使用python爬虫实现百度翻译功能 python爬虫实现百度翻译: python解释器[模拟浏览器],发送[post请求],传入待[翻译的内容]作为参数,获取[百度翻译的结果] 通过开发者工具,获取 ...

  8. 自学git心得-5

    标签管理也是git里面比较重要的一部分内容,我们下载软件的时候经常看到诸如v2.0.v2.3.0这样的版本号,在git里也是一样,有时为了避免分支的名称五花八门而发生混淆的情况,我们常常会 给分支贴上 ...

  9. Oracle数据库从入门到精通-分组统计查询

    视频课程:李兴华 Oracle从入门到精通 视频课程学习者:阳光罗诺 视频来源:51CTO学院 整体内容: 统计函数的使用 分组统计查询的实现 对分组的数据过滤 统计函数 在之前我们就学习过一个COU ...

  10. Http扫盲

    https://www.kancloud.cn/kancloud/tealeaf-http/43832