Adding APIT in NS2.35 Ubuntu 16.04

2019-08-18 18:39发布

Dear ns2 user after I edit cmu-trace.cc file in ns2.35 to add APIT many errors were generated. some of them are the following. please help me. thank you in advance.

 trace/cmu-trace.cc: In member function ‘void CMUTrace::format_apit(Packet*, int)’:
trace/cmu-trace.cc:1077:45: error: ‘HDR_APIT’ was not declared in this scope
             struct hdr_apit *wd = HDR_APIT(p);
                                             ^
trace/cmu-trace.cc:1078:60: error: ‘HDR_APIT_BEACON’ was not declared in this scope
             struct hdr_apit_beacon *bcn = HDR_APIT_BEACON(p);
                                                            ^
trace/cmu-trace.cc:1079:57: error: ‘HDR_APIT_RSSI’ was not declared in this scope
             struct hdr_apit_rssi *rssi = HDR_APIT_RSSI(p);
                                                         ^
.....

标签: ns2
1条回答
男人必须洒脱
2楼-- · 2019-08-18 19:44

The three "missing" definitions are done in apit_packet.h, line 41 .. 43

#define HDR_APIT(p)             ((struct hdr_apit*)hdr_apit::access(p))
#define HDR_APIT_BEACON(p)      ((struct hdr_apit_beacon*)hdr_apit::access(p))
#define HDR_APIT_RSSI(p)        ((struct hdr_apit_rssi*)hdr_apit::access(p))

... So all you have to do is to add a line (66) to cmu-trace.cc :

#include <apit/apit_packet.h>
查看更多
登录 后发表回答