android系统tun_tun.h - Android社区 - https://www.androidos.net.cn/

/*

* Copyright 2014 The Android Open Source Project

*

* Licensed under the Apache License, Version 2.0 (the "License");

* you may not use this file except in compliance with the License.

* You may obtain a copy of the License at

*

* http://www.apache.org/licenses/LICENSE-2.0

*

* Unless required by applicable law or agreed to in writing, software

* distributed under the License is distributed on an "AS IS" BASIS,

* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

* See the License for the specific language governing permissions and

* limitations under the License.

*

* tun.h - tun device functions

*/

#ifndef __TUN_H__

#define __TUN_H__

#include #include #include #include #include "common.h"

#include "ring.h"

struct tun_data {

char device4[IFNAMSIZ];

int read_fd6, write_fd6, fd4;

struct packet_ring ring;

};

// tun_open and tun_alloc are defined in tun.c and only used by clatd_microbenchmark.c

int tun_open();

int tun_alloc(char *dev, int fd, size_t len);

/* function: send_tun

* sends a clat_packet to a tun interface

* fd - the tun filedescriptor

* out - the packet to send

* iov_len - the number of entries in the clat_packet

* returns: number of bytes read on success, -1 on failure

*/

static inline int send_tun(int fd, clat_packet out, int iov_len) {

return writev(fd, out, iov_len);

}

#endif

C++程序

|

51行

|

1.39 KB

/*

* Copyright 2014 The Android Open Source Project

*

* Licensed under the Apache License, Version 2.0 (the "License");

* you may not use this file except in compliance with the License.

* You may obtain a copy of the License at

*

* http://www.apache.org/licenses/LICENSE-2.0

*

* Unless required by applicable law or agreed to in writing, software

* distributed under the License is distributed on an "AS IS" BASIS,

* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

* See the License for the specific language governing permissions and

* limitations under the License.

*

* tun.h - tun device functions

*/

#ifndef __TUN_H__

#define __TUN_H__

#include

#include

#include

#include

#include "common.h"

#include "ring.h"

struct tun_data {

char device4[IFNAMSIZ];

int read_fd6, write_fd6, fd4;

struct packet_ring ring;

};

// tun_open and tun_alloc are defined in tun.c and only used by clatd_microbenchmark.c

int tun_open();

int tun_alloc(char *dev, int fd, size_t len);

/* function: send_tun

* sends a clat_packet to a tun interface

* fd - the tun filedescriptor

* out - the packet to send

* iov_len - the number of entries in the clat_packet

* returns: number of bytes read on success, -1 on failure

*/

static inline int send_tun(int fd, clat_packet out, int iov_len) {

return writev(fd, out, iov_len);

}

#endif

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误通常表示在编译`aqua-sim-routing-dummy.cc`文件时出现了问题。根据日志,这是通过使用g++编译器尝试编译该文件的命令: ```shell /usr/bin/g++ -O0 -ggdb -g3 -Wall -Werror -std=c++11 -Wno-error=deprecated-declarations -fstrict-aliasing -Wstrict-aliasing -fPIC -pthread -I. -I.. -DNS3_BUILD_PROFILE_DEBUG -DNS3_ASSERT_ENABLE -DNS3_LOG_ENABLE -DHAVE_SYS_IOCTL_H=1 -DHAVE_IF_NETS_H=1 -DHAVE_NET_ETHERNET_H=1 -DHAVE_PACKET_H=1 -DHAVE_IF_TUN_H=1 -DHAVE_GSL=1 -DHAVE_SQLITE3=1 ../src/aqua-sim-ng/model/aqua-sim-routing-dummy.cc -c -o /home/fjl/ns-allinone-3.26/ns-3.26/build/src/aqua-sim-ng/model/aqua-sim-routing-dummy.cc.1.o ``` 根据命令和错误信息,可能有以下一些原因导致构建失败: 1. 缺少某些依赖项:请确保你的系统中安装了所有必需的依赖项。在这个特定的情况下,确保你的系统中安装了g++编译器、pthread库、以及其他相关的头文件和库。 2. 编译器错误:有时候编译器可能会有一些问题,尝试更新或更换你的编译器版本,可能会解决该问题。 3. 文件路径错误:检查`../src/aqua-sim-ng/model/aqua-sim-routing-dummy.cc`文件是否存在,并确保路径正确。 4. 代码错误:在`aqua-sim-routing-dummy.cc`文件中可能存在语法错误或其他编译错误。请仔细检查该文件,并确保代码没有问题。 希望这些提示能够帮助你解决构建失败的问题!如果还有其他疑问,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值