ChinaUnix.net
相关文章推荐:

linux socket 获取IP 博客

做了一个linux下的socket程序,基于TCP协议,当有别的计算机访问的时候,服务器端要怎么获得访问者的ip和MAC地址?

by shineyear - C/C++ - 2008-10-08 10:41:26 阅读(15549) 回复(15)

相关讨论

我对linux不熟,现在想学习一下 但是 单位的 ip 都是动态分配的 不知道在linux下怎么自动获取ip 谢谢各位

by netstorm - Linux论坛 - 2003-07-03 15:11:11 阅读(544) 回复(3)

#include #include int main() { FILE *fpr; char devicecfg[50]; char *device="eth0"; sprintf(devicecfg,"/etc/sysconfig/network-scripts/ifcfg-%s",device); char buf[1024],*p; int i; char gwip[20]={0}; if((fpr=fopen(devicecfg, "r"))==NULL) { printf("open device config faile\n"); return -1; } memset(buf, 0, sizeof(...

网络技术

by hackersea - 网络技术 - 2008-08-27 18:23:16 阅读(2518) 回复(3)

最近在做linux平台下用C语言实现ip地址的自动获取和静态获取,目前我只做了静态获取ip,但不懂得怎么实现自动获取ip,希望高手能够指点迷津,谢谢了。 注:    我是要在开发板上实现ip动态获取的,不是在PC机上动态获取,dhcp服务在开发板上如何安装和配置,有做过类似的高手请指教。 [ 本帖最后由 hxh88888888 于 2009-8-24 10:14 编辑 ]

by hxh88888888 - C/C++ - 2009-08-24 15:08:51 阅读(2630) 回复(4)

如何在linux bridge 中通过MAC地址获取ip地址呢? 类似于在线状态用户功能的实现

by yangfan40207 - 网络技术 - 2008-10-28 18:03:16 阅读(4672) 回复(9)

查了下资料没查到什么函数。 哪位知道的指点一下,非常感谢!

by mengwg - C/C++ - 2006-03-21 17:33:01 阅读(1425) 回复(1)

代码如下: [code] #include //#include #include #include #include #include socket.h> #include #include #include #include #include #include #include #include int main(int argc, char **argv) { int sockfd; char *ptr; struct ...

by amoyppa - C/C++ - 2013-03-22 16:36:51 阅读(5051) 回复(7)

请问 linux从win2000动态获取ip如何在linux知道分配请矿

by pdiunix - Linux论坛 - 2004-02-01 13:04:31 阅读(753) 回复(18)

如题,我要根据主机名称找到主机对应ip地址,有这方面的命令吗? 。。。。。。。 为什么本帖被关闭?!斑竹为啥啊! [ 本帖最后由 jinyonghe 于 2008-9-18 22:32 编辑 ]

by jinyonghe - C/C++ - 2008-09-18 20:43:40 阅读(1482) 回复(1)

在windows下会提示输入密钥,可是在linux下根本没有这个.所以直接导致无法获取ip.不能建立连接. 在/etc/sysconfig/network-scripts/ifcfg-wlan0文件中有没有相关的参数可以指定密钥? 谢谢!

by frank533 - 网络与硬件 - 2005-12-03 17:25:58 阅读(946) 回复(2)

用gethostname,gethostbyname,之后 只能获取一个ip

by chestnut king - C/C++ - 2005-12-11 20:07:25 阅读(3429) 回复(5)