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

📄 netiptostring.c

📁 lwIP-Softools-11Jul2002-alpha
💻 C
字号:
/* * Utility function to convert an ip address to a string. * * (C) 2002 Compendium Technologies, Inc. * (C) 2002 Softools, Inc. * All rights reserved. * * This software is the proprietary information of Compendium Technologies, Inc. * and Softools, Inc. Use is subject to license terms. */#include <string.h>#include <stdlib.h>#include "rabbitlwip.h"/** * Note: this only converts ipv4 right now. It also only currently works for * little endian systems. */char *netIPToString(struct ip_addr * nsip, char * address){    u32_t ip = nsip->addr;    char i;    *address = 0;    for (i = 0; i <= 24; i+= 8)    {        if (i != 0)            strcat(address, ".");        itoa((int) (ip >> i) & 0xff, strchr(address, 0), 10);    }    return address;}

⌨️ 快捷键说明

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