Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
fe4ff24a
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fe4ff24a
编写于
4月 25, 2010
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
linux/if.h header is not available on non-Linux platforms
上级
5c7c755f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
47 addition
and
2 deletion
+47
-2
src/util/interface.c
src/util/interface.c
+47
-2
未找到文件。
src/util/interface.c
浏览文件 @
fe4ff24a
...
...
@@ -27,7 +27,10 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <linux/if.h>
#ifdef __linux__
# include <linux/if.h>
#endif
#include "internal.h"
...
...
@@ -40,7 +43,7 @@
__FUNCTION__, __LINE__, __VA_ARGS__)
/*
* chgIfFlags: Change flags on an interface
* chgIf
ace
Flags: Change flags on an interface
*
* @ifname : name of the interface
* @flagclear : the flags to clear
...
...
@@ -52,6 +55,7 @@
*
* Returns 0 on success, errno on failure.
*/
#ifdef __linux__
static
int
chgIfaceFlags
(
const
char
*
ifname
,
short
flagclear
,
short
flagset
)
{
struct
ifreq
ifr
;
int
rc
=
0
;
...
...
@@ -105,6 +109,15 @@ ifaceCtrl(const char *name, bool up)
(
up
)
?
IFF_UP
:
0
);
}
#else
int
ifaceCtrl
(
const
char
*
name
ATTRIBUTE_UNUSED
,
bool
up
ATTRIBUTE_UNUSED
)
{
return
ENOSYS
;
}
#endif
/* __linux__ */
/**
* ifaceCheck
...
...
@@ -123,6 +136,7 @@ ifaceCtrl(const char *name, bool up)
* index is different than the one passed
* EINVAL : if interface name is invalid (too long)
*/
#ifdef __linux__
int
ifaceCheck
(
bool
reportError
,
const
char
*
ifname
,
const
unsigned
char
*
macaddr
,
int
ifindex
)
...
...
@@ -175,6 +189,19 @@ ifaceCheck(bool reportError, const char *ifname,
return
rc
;
}
#else
int
ifaceCheck
(
bool
reportError
ATTRIBUTE_UNUSED
,
const
char
*
ifname
ATTRIBUTE_UNUSED
,
const
unsigned
char
*
macaddr
ATTRIBUTE_UNUSED
,
int
ifindex
ATTRIBUTE_UNUSED
)
{
return
ENOSYS
;
}
#endif
/* __linux__ */
/**
* ifaceGetIndex
...
...
@@ -189,6 +216,7 @@ ifaceCheck(bool reportError, const char *ifname,
* ENODEV : if interface with given name does not exist
* EINVAL : if interface name is invalid (too long)
*/
#ifdef __linux__
int
ifaceGetIndex
(
bool
reportError
,
const
char
*
ifname
,
int
*
ifindex
)
{
...
...
@@ -224,3 +252,20 @@ err_exit:
return
rc
;
}
#else
int
ifaceGetIndex
(
bool
reportError
,
const
char
*
ifname
ATTRIBUTE_UNUSED
,
int
*
ifindex
ATTRIBUTE_UNUSED
)
{
if
(
reportError
)
{
ifaceError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"ifaceGetIndex is not supported on non-linux platforms"
));
}
return
ENOSYS
;
}
#endif
/* __linux__ */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录