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) 2008 INRIA | 3 * Copyright (c) 2008 INRIA |
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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 */ | 567 */ |
568 static void | 568 static void |
569 Ipv4L3ProtocolDropSinkWithoutContext ( | 569 Ipv4L3ProtocolDropSinkWithoutContext ( |
570 Ptr<OutputStreamWrapper> stream, | 570 Ptr<OutputStreamWrapper> stream, |
571 Ipv4Header const &header,· | 571 Ipv4Header const &header,· |
572 Ptr<const Packet> packet, | 572 Ptr<const Packet> packet, |
573 Ipv4L3Protocol::DropReason reason,· | 573 Ipv4L3Protocol::DropReason reason,· |
574 Ptr<Ipv4> ipv4,· | 574 Ptr<Ipv4> ipv4,· |
575 uint32_t interface) | 575 uint32_t interface) |
576 { | 576 { |
577 NS_UNUSED(reason); | 577 NS_UNUSED (reason); |
578 // | 578 // |
579 // Since trace sources are independent of interface, if we hook a source | 579 // Since trace sources are independent of interface, if we hook a source |
580 // on a particular protocol we will get traces for all of its interfaces. | 580 // on a particular protocol we will get traces for all of its interfaces. |
581 // We need to filter this to only report interfaces for which the user· | 581 // We need to filter this to only report interfaces for which the user· |
582 // has expressed interest. | 582 // has expressed interest. |
583 // | 583 // |
584 InterfacePairIpv4 pair = std::make_pair (ipv4, interface); | 584 InterfacePairIpv4 pair = std::make_pair (ipv4, interface); |
585 if (g_interfaceStreamMapIpv4.find (pair) == g_interfaceStreamMapIpv4.end ()) | 585 if (g_interfaceStreamMapIpv4.find (pair) == g_interfaceStreamMapIpv4.end ()) |
586 { | 586 { |
587 NS_LOG_INFO ("Ignoring packet to/from interface " << interface); | 587 NS_LOG_INFO ("Ignoring packet to/from interface " << interface); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 static void | 654 static void |
655 Ipv4L3ProtocolDropSinkWithContext ( | 655 Ipv4L3ProtocolDropSinkWithContext ( |
656 Ptr<OutputStreamWrapper> stream, | 656 Ptr<OutputStreamWrapper> stream, |
657 std::string context, | 657 std::string context, |
658 Ipv4Header const &header,· | 658 Ipv4Header const &header,· |
659 Ptr<const Packet> packet, | 659 Ptr<const Packet> packet, |
660 Ipv4L3Protocol::DropReason reason,· | 660 Ipv4L3Protocol::DropReason reason,· |
661 Ptr<Ipv4> ipv4,· | 661 Ptr<Ipv4> ipv4,· |
662 uint32_t interface) | 662 uint32_t interface) |
663 { | 663 { |
664 NS_UNUSED(reason); | 664 NS_UNUSED (reason); |
665 // | 665 // |
666 // Since trace sources are independent of interface, if we hook a source | 666 // Since trace sources are independent of interface, if we hook a source |
667 // on a particular protocol we will get traces for all of its interfaces. | 667 // on a particular protocol we will get traces for all of its interfaces. |
668 // We need to filter this to only report interfaces for which the user· | 668 // We need to filter this to only report interfaces for which the user· |
669 // has expressed interest. | 669 // has expressed interest. |
670 // | 670 // |
671 InterfacePairIpv4 pair = std::make_pair (ipv4, interface); | 671 InterfacePairIpv4 pair = std::make_pair (ipv4, interface); |
672 if (g_interfaceStreamMapIpv4.find (pair) == g_interfaceStreamMapIpv4.end ()) | 672 if (g_interfaceStreamMapIpv4.find (pair) == g_interfaceStreamMapIpv4.end ()) |
673 { | 673 { |
674 NS_LOG_INFO ("Ignoring packet to/from interface " << interface); | 674 NS_LOG_INFO ("Ignoring packet to/from interface " << interface); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 */ | 907 */ |
908 static void | 908 static void |
909 Ipv6L3ProtocolDropSinkWithoutContext ( | 909 Ipv6L3ProtocolDropSinkWithoutContext ( |
910 Ptr<OutputStreamWrapper> stream, | 910 Ptr<OutputStreamWrapper> stream, |
911 Ipv6Header const &header,· | 911 Ipv6Header const &header,· |
912 Ptr<const Packet> packet, | 912 Ptr<const Packet> packet, |
913 Ipv6L3Protocol::DropReason reason,· | 913 Ipv6L3Protocol::DropReason reason,· |
914 Ptr<Ipv6> ipv6,· | 914 Ptr<Ipv6> ipv6,· |
915 uint32_t interface) | 915 uint32_t interface) |
916 { | 916 { |
917 NS_UNUSED(reason); | 917 NS_UNUSED (reason); |
918 // | 918 // |
919 // Since trace sources are independent of interface, if we hook a source | 919 // Since trace sources are independent of interface, if we hook a source |
920 // on a particular protocol we will get traces for all of its interfaces. | 920 // on a particular protocol we will get traces for all of its interfaces. |
921 // We need to filter this to only report interfaces for which the user· | 921 // We need to filter this to only report interfaces for which the user· |
922 // has expressed interest. | 922 // has expressed interest. |
923 // | 923 // |
924 InterfacePairIpv6 pair = std::make_pair (ipv6, interface); | 924 InterfacePairIpv6 pair = std::make_pair (ipv6, interface); |
925 if (g_interfaceStreamMapIpv6.find (pair) == g_interfaceStreamMapIpv6.end ()) | 925 if (g_interfaceStreamMapIpv6.find (pair) == g_interfaceStreamMapIpv6.end ()) |
926 { | 926 { |
927 NS_LOG_INFO ("Ignoring packet to/from interface " << interface); | 927 NS_LOG_INFO ("Ignoring packet to/from interface " << interface); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 static void | 994 static void |
995 Ipv6L3ProtocolDropSinkWithContext ( | 995 Ipv6L3ProtocolDropSinkWithContext ( |
996 Ptr<OutputStreamWrapper> stream, | 996 Ptr<OutputStreamWrapper> stream, |
997 std::string context, | 997 std::string context, |
998 Ipv6Header const &header,· | 998 Ipv6Header const &header,· |
999 Ptr<const Packet> packet, | 999 Ptr<const Packet> packet, |
1000 Ipv6L3Protocol::DropReason reason,· | 1000 Ipv6L3Protocol::DropReason reason,· |
1001 Ptr<Ipv6> ipv6,· | 1001 Ptr<Ipv6> ipv6,· |
1002 uint32_t interface) | 1002 uint32_t interface) |
1003 { | 1003 { |
1004 NS_UNUSED(reason); | 1004 NS_UNUSED (reason); |
1005 // | 1005 // |
1006 // Since trace sources are independent of interface, if we hook a source | 1006 // Since trace sources are independent of interface, if we hook a source |
1007 // on a particular protocol we will get traces for all of its interfaces. | 1007 // on a particular protocol we will get traces for all of its interfaces. |
1008 // We need to filter this to only report interfaces for which the user· | 1008 // We need to filter this to only report interfaces for which the user· |
1009 // has expressed interest. | 1009 // has expressed interest. |
1010 // | 1010 // |
1011 InterfacePairIpv6 pair = std::make_pair (ipv6, interface); | 1011 InterfacePairIpv6 pair = std::make_pair (ipv6, interface); |
1012 if (g_interfaceStreamMapIpv6.find (pair) == g_interfaceStreamMapIpv6.end ()) | 1012 if (g_interfaceStreamMapIpv6.find (pair) == g_interfaceStreamMapIpv6.end ()) |
1013 { | 1013 { |
1014 NS_LOG_INFO ("Ignoring packet to/from interface " << interface); | 1014 NS_LOG_INFO ("Ignoring packet to/from interface " << interface); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 Config::Connect (oss.str (), MakeBoundCallback (&Ipv6L3ProtocolTxSinkWithC
ontext, stream)); | 1209 Config::Connect (oss.str (), MakeBoundCallback (&Ipv6L3ProtocolTxSinkWithC
ontext, stream)); |
1210 oss.str (""); | 1210 oss.str (""); |
1211 oss << "/NodeList/" << node->GetId () << "/$ns3::Ipv6L3Protocol/Rx"; | 1211 oss << "/NodeList/" << node->GetId () << "/$ns3::Ipv6L3Protocol/Rx"; |
1212 Config::Connect (oss.str (), MakeBoundCallback (&Ipv6L3ProtocolRxSinkWithC
ontext, stream)); | 1212 Config::Connect (oss.str (), MakeBoundCallback (&Ipv6L3ProtocolRxSinkWithC
ontext, stream)); |
1213 } | 1213 } |
1214 | 1214 |
1215 g_interfaceStreamMapIpv6[std::make_pair (ipv6, interface)] = stream; | 1215 g_interfaceStreamMapIpv6[std::make_pair (ipv6, interface)] = stream; |
1216 } | 1216 } |
1217 | 1217 |
1218 } // namespace ns3 | 1218 } // namespace ns3 |
LEFT | RIGHT |