LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 Universita' di Firenze, Italy | 3 * Copyright (c) 2011 Universita' di Firenze, Italy |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include <string> | 26 #include <string> |
27 | 27 |
28 namespace ns3 { | 28 namespace ns3 { |
29 | 29 |
30 class Node; | 30 class Node; |
31 class AttributeValue; | 31 class AttributeValue; |
32 | 32 |
33 /** | 33 /** |
34 * \ingroup sixlowpan | 34 * \ingroup sixlowpan |
35 * | 35 * |
36 * \brief Setup a sixlowpan stack to be used as a middleware between IPv6 and a
generic NetDevice. | 36 * \brief Setup a sixlowpan stack to be used as a shim between IPv6 and a generi
c NetDevice. |
37 */ | 37 */ |
38 class SixLowPanHelper | 38 class SixLowPanHelper |
39 { | 39 { |
40 public: | 40 public: |
41 /* | 41 /* |
42 * Construct a SixlowpanHelper | 42 * Construct a SixlowpanHelper |
43 */ | 43 */ |
44 SixLowPanHelper (); | 44 SixLowPanHelper (); |
45 /** | 45 /** |
46 * Set an attribute on each ns3::SixlowpanNetDevice created by | 46 * Set an attribute on each ns3::SixlowpanNetDevice created by |
47 * SixlowpanHelper::Install | 47 * SixlowpanHelper::Install. |
48 * | 48 * |
49 * \param n1 the name of the attribute to set | 49 * \param n1 the name of the attribute to set |
50 * \param v1 the value of the attribute to set | 50 * \param v1 the value of the attribute to set |
51 */ | 51 */ |
52 void SetDeviceAttribute (std::string n1, | 52 void SetDeviceAttribute (std::string n1, |
53 const AttributeValue &v1); | 53 const AttributeValue &v1); |
54 | 54 |
55 /** | 55 /** |
56 * Install the SixLoWPAN stack on top of an existing NetDevice. | 56 * \brief Install the SixLoWPAN stack on top of an existing NetDevice. |
| 57 * |
57 * This function requires a set of properly configured NetDevices | 58 * This function requires a set of properly configured NetDevices |
| 59 * passed in as the parameter "c". The new NetDevices will have to |
| 60 * be used instead of the original ones. In this way these |
| 61 * SixLoWPAN devices will behave as shims between the NetDevices |
| 62 * passed in and IPv6. |
| 63 * |
| 64 * Note that only IPv6 (and related protocols, such as ICMPv6) can |
| 65 * be transmitted over a 6LoWPAN interface. |
| 66 * Any other protocol (e.g., IPv4) will be discarded by 6LoWPAN. |
| 67 * |
| 68 * Other protocols (e.g., IPv4) could be used on the original NetDevices |
| 69 * with some limitations. |
| 70 * See the manual for a complete discussion. |
| 71 * |
| 72 * \note IPv6 stack must be installed \a after SixLoWPAN, |
| 73 * using the SixLoWPAN NetDevices. See the example in the |
| 74 * examples directory. |
| 75 * |
58 * | 76 * |
59 * \param c the NetDevice container | 77 * \param c the NetDevice container |
60 * \return a container with the newly created NetDevices | 78 * \return a container with the newly created SixLowPanNetDevices |
61 */ | 79 */ |
62 NetDeviceContainer Install (NetDeviceContainer c); | 80 NetDeviceContainer Install (NetDeviceContainer c); |
| 81 |
| 82 /** |
| 83 * Assign a fixed random variable stream number to the random variables |
| 84 * used by this model. Return the number of streams (possibly zero) that |
| 85 * have been assigned. The Install() method should have previously been |
| 86 * called by the user. |
| 87 * |
| 88 * \param c NetDeviceContainer of the set of net devices for which the |
| 89 * SixLowPanNetDevice should be modified to use a fixed stream |
| 90 * \param stream first stream index to use |
| 91 * \return the number of stream indices assigned by this helper |
| 92 */ |
| 93 int64_t AssignStreams (NetDeviceContainer c, int64_t stream); |
| 94 |
63 private: | 95 private: |
64 ObjectFactory m_deviceFactory; //!< Object factory | 96 ObjectFactory m_deviceFactory; //!< Object factory |
65 }; | 97 }; |
66 | 98 |
67 } // namespace ns3 | 99 } // namespace ns3 |
68 | 100 |
69 | 101 |
70 #endif /* SIXLOWPAN_HELPER_H */ | 102 #endif /* SIXLOWPAN_HELPER_H */ |
LEFT | RIGHT |