我有一个补丁文件,内容如下:
Only in /tmp/ns-allinone-2.26/ns-2.26/common: ip.o
Only in /tmp/ns-allinone-2.26/ns-2.26/common: ivs.o
Only in /tmp/ns-allinone-2.26/ns-2.26/common: message.o
Only in /tmp/ns-allinone-2.26/ns-2.26/common: misc.o
diff -r ns-2.26/common/mobilenode.cc /tmp/ns-allinone-2.26/ns-2.26/common/mobilenode.cc
64a65,68
> #ifdef GgX
> #include "wireless-phy.h"
> #include "mac-802_11.h"
> #endif GgX
128a133
>
147a153,157
>
> #ifdef GgX
> Mac802_11* macptr;
> #endif GgX
>
266a277,294
>
> #ifdef GgX //GgX - To have an access to change rate!
> } else if (strcmp(argv[1], "change_rate") == 0) {
> macptr = (Mac802_11*) ifhead_.lh_first->uptarget();
> if (macptr) {
> // Keep attention GgX supposes only 1
> // interface present!
> macptr->setRate(atoi(argv[2]));
> fprintf(stderr, "Rate changed to: %d\n\n",\
> atoi(argv[2]));
> return TCL_OK;
> } else {
> fprintf(stderr, "Error.. Mac not found..\n");
> return(TCL_ERROR);
> };
> return TCL_OK;
> #endif // GgX
>
如何将此文件修补到 ns2.26?我试过了,patch -p0 < <file_patch>
但出现错误:
patch: **** Only garbage was found in the patch input.
请帮我。