Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1348136
  • 博文数量: 244
  • 博客积分: 10311
  • 博客等级: 上将
  • 技术积分: 3341
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-14 21:50
文章分类

全部博文(244)

文章存档

2013年(6)

2012年(5)

2011年(16)

2010年(11)

2009年(172)

2008年(34)

分类: LINUX

2009-05-25 11:32:39

u32 get_ip_by_eth_name(const char *name)
{
    u32 ret = 0;
    struct net_device *nd = NULL;

    if ( (nd = dev_get_by_name(name)) != NULL) {
        ret = inet_select_addr(nd, 0, 0);
        dev_put(nd); /* to release net_device */
    }
    return ret;
}
阅读(852) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~