【问题标题】:How to apply the OSPF patch to ns2 2.35 on ubuntu 14.04如何在 ubuntu 14.04 上将 OSPF 补丁应用于 ns2 2.35
【发布时间】:2015-03-15 19:20:41
【问题描述】:

我在 ubuntu 上使用 ns2nam 已经有很长时间了。现在我必须对其应用补丁 (OSPF)。我一直在寻找如何在 linux 中应用补丁(因为我是新手),我得到的只是:

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 文件复制到名为 10-ospf4ns2.34-base.patchns-allinone-2.35 文件夹中,转到终端中的目录,使用 ln -s ns-2.35/ ns-2.34,然后使用行 4 进行修补。之后我收到这些消息:

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 新手。

【问题讨论】:

    标签: linux ubuntu patch ns2 ospf


    【解决方案1】:

    看起来您之前已经(至少部分)应用了补丁,并且您不在正确的目录中。

    重新开始,您也可以通过以下说明避免符号链接:

    1. 在新目录中提取 ns-allinone-2.35.tar.gz。

    2. cd ns-allinone-2.35/ns-2.35

    3. 应用补丁:

      补丁-p1

    【讨论】:

    • 看来我已经申请了,因为我确实申请了好几次。直到它没有找到文件ns-2.34/classifier/classifier-mtopology.h。我认为它可能只应用于文件夹ns-2.35,但由于补丁名称指示2.34 并使用$ ln -s ns-2.35/ ns-2.34,我认为它会将补丁应用于ns-2.34ns-2.35 文件夹。我一到我的 ubuntu 就会尝试,谢谢。
    • 不应该是patch -p1 &lt; ../10-ospf4ns2.34-base.patch,因为我在ns-2.35文件夹内申请吗?请问为什么是p1 而不是p0
    • 是的,如果您在上次执行的位置提取它,您将不得不使用../10-...。至于-p1,它“吃掉”路径的一个组成部分,因此名称ns-2.34/classifier/classifier-mtopology.h 变为classifier/classifier-mtopology.h,因此您不需要符号链接,但您需要使用cd ns-allinone-2.35/ns-2.35
    • 谢谢,你知道p1p0有什么区别吗?
    猜你喜欢
    • 2014-06-19
    • 2016-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-05
    • 1970-01-01
    • 1970-01-01
    • 2011-11-04
    相关资源
    最近更新 更多