equal
deleted
inserted
replaced
157 * method which is described in the following sections. |
157 * method which is described in the following sections. |
158 * |
158 * |
159 * \section TraceConnection Connecting Trace Sources to Trace Sinks |
159 * \section TraceConnection Connecting Trace Sources to Trace Sinks |
160 * |
160 * |
161 * If a trace source is integrated in the ns-3 trace connection facility, a user |
161 * If a trace source is integrated in the ns-3 trace connection facility, a user |
162 * should call the ns3::NodeList::Connect method to establish a connection between |
162 * should call the ns3::NodeList::ConnectWithoutContext method to establish a connection between |
163 * a trace sink and a set of matching trace sources. The second argument to that |
163 * a trace sink and a set of matching trace sources. The second argument to that |
164 * method is a callback to the user's trace sink. |
164 * method is a callback to the user's trace sink. |
165 * That callback is easy to construct: call ns3::MakeCallback and you are done. The |
165 * That callback is easy to construct: call ns3::MakeCallback and you are done. The |
166 * first argument is a string whose format is similar to a unix path and which is |
166 * first argument is a string whose format is similar to a unix path and which is |
167 * used to uniquely identify the set of trace sources you want to connect to. |
167 * used to uniquely identify the set of trace sources you want to connect to. |
176 * { |
176 * { |
177 * // for example, print the packet |
177 * // for example, print the packet |
178 * std::cout << "packet: " << packet->Print () << std::endl; |
178 * std::cout << "packet: " << packet->Print () << std::endl; |
179 * } |
179 * } |
180 * // connect the above sink to a matching trace source |
180 * // connect the above sink to a matching trace source |
181 * NodeList::Connect ("/nodes/* /devices/* /rx", MakeCallback (&DoSomethingTraceSink)); |
181 * NodeList::ConnectWithoutContext ("/nodes/* /devices/* /rx", MakeCallback (&DoSomethingTraceSink)); |
182 * \endcode |
182 * \endcode |
183 * |
183 * |
184 * The connection path string "/nodes/* /devices/* /rx" matches the "rx" trace source |
184 * The connection path string "/nodes/* /devices/* /rx" matches the "rx" trace source |
185 * located in every netdevice located in every node. The syntax of that path string |
185 * located in every netdevice located in every node. The syntax of that path string |
186 * is loosely based on regular expressions so, a user could conceivably connect |
186 * is loosely based on regular expressions so, a user could conceivably connect |