如何在 ubuntu 14.04 上将 OSPF 补丁应用到 ns2 2.35 [英] How to apply the OSPF patch to ns2 2.35 on ubuntu 14.04
问题描述
我在 ubuntu 上使用 ns2
和 nam
已经很长时间了.现在我必须对其应用补丁 (OSPF
).我一直在寻找如何在 linux 中应用补丁(因为我对它有点陌生),我得到的只是:
I have been using ns2
and nam
for a long time on my ubuntu. Now I have to apply a patch (OSPF
) to it. I have been searching for how to apply a patch in linux (as I'm kind of new in it) and all I got was:
1) $ tar xvf ns-allinone-2.35.tar.gz
2) $ cd ns-allinone-2.35/
3) $ ln -s ns-2.35/ ns-2.34
... Then the patch will work, except for one line. (commom/packet.h).
4) $ patch -p0 < 10-ospf4ns2.34-base.patch
http://sourceforge.net/projects/ospf4ns/
5) Replace commom/packet.h with the attached "packet.h" : Edited by hand.
6) export CC=gcc44 CXX=g++44 && ./install
我解压了 tar 文件,将 .patch
文件复制到了 ns-allinone-2.35
文件夹中,名为 10-ospf4ns2.34-base.patch
,转到终端中的目录,使用 ln -s ns-2.35/ns-2.34
然后使用 4
行修补.之后我有这些消息:
I untared the tar file, copied the .patch
file in the ns-allinone-2.35
folder called 10-ospf4ns2.34-base.patch
, gone to the directory in a terminal, used ln -s ns-2.35/ ns-2.34
and then patched using line 4
. After that I have these messages:
The next patch would create the file ns-2.34/classifier/classifier-mtopology.cc,
which already exists! Assume -R? [n] y
patching file ns-2.34/classifier/classifier-mtopology.cc
The next patch would create the file ns-2.34/classifier/classifier-mtopology.h,
which already exists! Assume -R? [n] y
patching file ns-2.34/classifier/classifier-mtopology.h
can't find file to patch at input line 92
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- ns-2.34.old/common/agent.cc 2009-06-14 18:35:45.000000000 +0100
|+++ ns-2.34/common/agent.cc 2010-02-26 23:34:33.161063590 +0000
--------------------------
File to patch:
这之后我不知道该怎么办.我应该修补什么文件?ns-2.34
中没有 classifier-mtopology.h
.之后,我应该用指定的新 packet.h
替换哪个 packet.h
?因为有几个 common
文件夹.任何帮助将不胜感激,因为我是 linux 新手.
After this I don't know what to do. What file should I patch? There is no classifier-mtopology.h
in ns-2.34
.
And after that, which packet.h
should I replace with the specified new packet.h
? Because there are several common
folders. Any help would be much appreciated cause I'm a novice in linux.
推荐答案
看起来您之前已经(至少部分)应用了补丁,并且您不在正确的目录中.
It looks like you already applied the patch before (at least partially) and that you are not in the correct directory.
重新开始,您也可以通过以下说明避免符号链接:
Start again, also you can avoid the symlink with the following instructions:
将 ns-allinone-2.35.tar.gz 解压到一个新目录中.
Extract ns-allinone-2.35.tar.gz in a fresh directory.
cd ns-allinone-2.35/ns-2.35
cd ns-allinone-2.35/ns-2.35
应用补丁:
补丁 -p1 <10-ospf4ns2.34-base.patch
patch -p1 < 10-ospf4ns2.34-base.patch
这篇关于如何在 ubuntu 14.04 上将 OSPF 补丁应用到 ns2 2.35的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!