Left: | ||
Right: |
OLD | NEW |
---|---|
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) 2007-2009 Strasbourg University | 3 * Copyright (c) 2007-2009 Strasbourg University |
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 16 matching lines...) Expand all Loading... | |
27 #include "ns3/object-vector.h" | 27 #include "ns3/object-vector.h" |
28 #include "ns3/ipv6-routing-protocol.h" | 28 #include "ns3/ipv6-routing-protocol.h" |
29 #include "ns3/ipv6-route.h" | 29 #include "ns3/ipv6-route.h" |
30 | 30 |
31 #include "loopback-net-device.h" | 31 #include "loopback-net-device.h" |
32 #include "ipv6-l3-protocol.h" | 32 #include "ipv6-l3-protocol.h" |
33 #include "ipv6-l4-protocol.h" | 33 #include "ipv6-l4-protocol.h" |
34 #include "ipv6-interface.h" | 34 #include "ipv6-interface.h" |
35 #include "ipv6-raw-socket-impl.h" | 35 #include "ipv6-raw-socket-impl.h" |
36 #include "ipv6-autoconfigured-prefix.h" | 36 #include "ipv6-autoconfigured-prefix.h" |
37 #include "ipv6-extension-demux.h" | |
38 #include "ipv6-extension.h" | |
39 #include "ipv6-extension-header.h" | |
40 #include "ipv6-option-demux.h" | |
41 #include "ipv6-option.h" | |
37 #include "icmpv6-l4-protocol.h" | 42 #include "icmpv6-l4-protocol.h" |
38 #include "ndisc-cache.h" | 43 #include "ndisc-cache.h" |
39 | 44 |
40 namespace ns3 | 45 namespace ns3 |
41 { | 46 { |
42 | 47 |
43 NS_OBJECT_ENSURE_REGISTERED (Ipv6L3Protocol); | 48 NS_OBJECT_ENSURE_REGISTERED (Ipv6L3Protocol); |
44 | 49 |
45 NS_LOG_COMPONENT_DEFINE ("Ipv6L3Protocol"); | 50 NS_LOG_COMPONENT_DEFINE ("Ipv6L3Protocol"); |
46 | 51 |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
685 Ipv6Header hdr; | 690 Ipv6Header hdr; |
686 packet->RemoveHeader (hdr); | 691 packet->RemoveHeader (hdr); |
687 | 692 |
688 /* forward up to IPv6 raw sockets */ | 693 /* forward up to IPv6 raw sockets */ |
689 for (SocketList::iterator it = m_sockets.begin () ; it != m_sockets.end () ; + +it) | 694 for (SocketList::iterator it = m_sockets.begin () ; it != m_sockets.end () ; + +it) |
690 { | 695 { |
691 Ptr<Ipv6RawSocketImpl> socket = *it; | 696 Ptr<Ipv6RawSocketImpl> socket = *it; |
692 socket->ForwardUp (packet, hdr, device); | 697 socket->ForwardUp (packet, hdr, device); |
693 } | 698 } |
694 | 699 |
700 Ptr<Ipv6ExtensionDemux> ipv6ExtensionDemux = m_node->GetObject<Ipv6ExtensionDe mux>(); | |
701 Ptr<Ipv6Extension> ipv6Extension = 0; | |
702 uint8_t nextHeader = hdr.GetNextHeader (); | |
703 bool isDropped = false; | |
704 | |
705 if (nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP) | |
706 { | |
707 ipv6Extension = ipv6ExtensionDemux->GetExtension (nextHeader); | |
708 | |
709 if (ipv6Extension) | |
710 { | |
711 ipv6Extension->Process (packet, 0, hdr, hdr.GetDestinationAddress (), (uin t8_t *)0, isDropped); | |
712 } | |
713 | |
714 if (isDropped) | |
715 { | |
716 return; | |
717 } | |
718 } | |
719 | |
695 m_routingProtocol->RouteInput (packet, hdr, device, | 720 m_routingProtocol->RouteInput (packet, hdr, device, |
696 MakeCallback (&Ipv6L3Protocol::IpForward, this), | 721 MakeCallback (&Ipv6L3Protocol::IpForward, this), |
697 MakeCallback (&Ipv6L3Protocol::IpMulticastForward, this), | 722 MakeCallback (&Ipv6L3Protocol::IpMulticastForward, this), |
698 MakeCallback (&Ipv6L3Protocol::LocalDeliver, this), | 723 MakeCallback (&Ipv6L3Protocol::LocalDeliver, this), |
699 MakeCallback (&Ipv6L3Protocol::RouteInputError, this) | 724 MakeCallback (&Ipv6L3Protocol::RouteInputError, this) |
700 ); | 725 ); |
701 } | 726 } |
702 | 727 |
703 void Ipv6L3Protocol::SendRealOut (Ptr<Ipv6Route> route, Ptr<Packet> packet, Ipv6 Header const& ipHeader) | 728 void Ipv6L3Protocol::SendRealOut (Ptr<Ipv6Route> route, Ptr<Packet> packet, Ipv6 Header const& ipHeader) |
704 { | 729 { |
705 NS_LOG_FUNCTION (this << route << packet << ipHeader); | 730 NS_LOG_FUNCTION (this << route << packet << ipHeader); |
706 | 731 |
707 if (!route) | 732 if (!route) |
708 { | 733 { |
709 NS_LOG_LOGIC ("No route to host, drop!."); | 734 NS_LOG_LOGIC ("No route to host, drop!."); |
710 return; | 735 return; |
711 } | 736 } |
712 | 737 |
713 Ptr<NetDevice> dev = route->GetOutputDevice (); | 738 Ptr<NetDevice> dev = route->GetOutputDevice (); |
714 int32_t interface = GetInterfaceForDevice (dev); | 739 int32_t interface = GetInterfaceForDevice (dev); |
715 NS_ASSERT (interface >= 0); | 740 NS_ASSERT (interface >= 0); |
716 ·· | 741 ·· |
717 Ptr<Ipv6Interface> outInterface = GetInterface (interface); | 742 Ptr<Ipv6Interface> outInterface = GetInterface (interface); |
718 NS_LOG_LOGIC ("Send via NetDevice ifIndex " << dev->GetIfIndex () << " Ipv6Int erfaceIndex " << interface); | 743 NS_LOG_LOGIC ("Send via NetDevice ifIndex " << dev->GetIfIndex () << " Ipv6Int erfaceIndex " << interface); |
719 | 744 |
745 // Check packet size | |
746 std::list<Ptr<Packet> > fragments; | |
747 | |
748 if (packet->GetSize () > (size_t)(dev->GetMtu () + 40)) /* 40 => size of IPv6 header */ | |
749 { | |
750 // Router => drop | |
751 if (m_ipForward) | |
752 { | |
753 return; | |
754 } | |
755 | |
756 Ptr<Ipv6ExtensionDemux> ipv6ExtensionDemux = m_node->GetObject<Ipv6Extension Demux> (); | |
757 | |
758 packet->AddHeader (ipHeader); | |
759 | |
760 // To get specific method GetFragments from Ipv6ExtensionFragmentation | |
761 Ipv6ExtensionFragment *ipv6Fragment = dynamic_cast<Ipv6ExtensionFragment *>( PeekPointer (ipv6ExtensionDemux->GetExtension (Ipv6Header::IPV6_EXT_FRAGMENTATIO N))); | |
762 ipv6Fragment->GetFragments (packet, outInterface->GetDevice ()->GetMtu (), f ragments); | |
763 } | |
764 | |
720 if (!route->GetGateway ().IsEqual (Ipv6Address::GetAny ())) | 765 if (!route->GetGateway ().IsEqual (Ipv6Address::GetAny ())) |
721 { | 766 { |
722 if (outInterface->IsUp ()) | 767 if (outInterface->IsUp ()) |
723 { | 768 { |
724 NS_LOG_LOGIC ("Send to gateway " << route->GetGateway ()); | 769 NS_LOG_LOGIC ("Send to gateway " << route->GetGateway ()); |
770 | |
771 if (fragments.size () != 0) | |
772 { | |
773 std::ostringstream oss; | |
774 | |
775 /* IPv6 header is already added in fragments */ | |
776 for (std::list<Ptr<Packet> >::const_iterator it = fragments.begin (); it != fragments.end (); it++) | |
777 { | |
778 m_txTrace (*it, interface); | |
779 outInterface->Send (*it, route->GetGateway ()); | |
780 } | |
781 } | |
782 else | |
783 { | |
784 /* NS_ASSERT (packet->GetSize () <= outInterface->GetDevice ()->GetMtu ( )); */ | |
moatamri
2009/10/30 11:31:30
remove commented code
ping67
2009/11/02 17:09:10
Done.
| |
725 packet->AddHeader (ipHeader); | 785 packet->AddHeader (ipHeader); |
726 NS_ASSERT (packet->GetSize () <= outInterface->GetDevice ()->GetMtu ()); | |
727 m_txTrace (packet, interface); | 786 m_txTrace (packet, interface); |
728 outInterface->Send (packet, route->GetGateway ()); | 787 outInterface->Send (packet, route->GetGateway ()); |
729 } | 788 } |
789 } | |
730 else | 790 else |
731 { | 791 { |
732 NS_LOG_LOGIC ("Dropping-- outgoing interface is down: " << route->GetGatew ay ()); | 792 NS_LOG_LOGIC ("Dropping-- outgoing interface is down: " << route->GetGatew ay ()); |
733 m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, interface); | 793 m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, interface); |
734 } | 794 } |
735 } | 795 } |
736 else | 796 else |
737 { | 797 { |
738 if (outInterface->IsUp ()) | 798 if (outInterface->IsUp ()) |
739 { | 799 { |
740 NS_LOG_LOGIC ("Send to destination " << ipHeader.GetDestinationAddress () ); | 800 NS_LOG_LOGIC ("Send to destination " << ipHeader.GetDestinationAddress () ); |
801 | |
802 if (fragments.size () != 0) | |
803 { | |
804 std::ostringstream oss; | |
805 ········ | |
806 /* IPv6 header is already added in fragments */ | |
807 for (std::list<Ptr<Packet> >::const_iterator it = fragments.begin (); it != fragments.end (); it++) | |
808 { | |
809 m_txTrace (*it, interface); | |
810 outInterface->Send (*it, ipHeader.GetDestinationAddress ()); | |
811 } | |
812 } | |
813 else | |
814 { | |
815 /* NS_ASSERT (packet->GetSize () <= outInterface->GetDevice ()->GetMtu ( )); */ | |
741 packet->AddHeader (ipHeader); | 816 packet->AddHeader (ipHeader); |
742 NS_ASSERT (packet->GetSize () <= outInterface->GetDevice ()->GetMtu ()); | |
743 m_txTrace (packet, interface); | 817 m_txTrace (packet, interface); |
744 outInterface->Send (packet, ipHeader.GetDestinationAddress ()); | 818 outInterface->Send (packet, ipHeader.GetDestinationAddress ()); |
745 } | 819 } |
820 } | |
746 else | 821 else |
747 { | 822 { |
748 NS_LOG_LOGIC ("Dropping-- outgoing interface is down: " << ipHeader.GetDes tinationAddress ()); | 823 NS_LOG_LOGIC ("Dropping-- outgoing interface is down: " << ipHeader.GetDes tinationAddress ()); |
749 m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, interface); | 824 m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, interface); |
750 } | 825 } |
751 } | 826 } |
752 } | 827 } |
753 | 828 |
754 void Ipv6L3Protocol::IpForward (Ptr<Ipv6Route> rtentry, Ptr<const Packet> p, con st Ipv6Header& header) | 829 void Ipv6L3Protocol::IpForward (Ptr<Ipv6Route> rtentry, Ptr<const Packet> p, con st Ipv6Header& header) |
755 { | 830 { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
848 SendRealOut (rtentry, packet, h); | 923 SendRealOut (rtentry, packet, h); |
849 return; | 924 return; |
850 } | 925 } |
851 } | 926 } |
852 } | 927 } |
853 | 928 |
854 void Ipv6L3Protocol::LocalDeliver (Ptr<const Packet> packet, Ipv6Header const& i p, uint32_t iif) | 929 void Ipv6L3Protocol::LocalDeliver (Ptr<const Packet> packet, Ipv6Header const& i p, uint32_t iif) |
855 { | 930 { |
856 NS_LOG_FUNCTION (this << packet << ip << iif); | 931 NS_LOG_FUNCTION (this << packet << ip << iif); |
857 Ptr<Packet> p = packet->Copy (); | 932 Ptr<Packet> p = packet->Copy (); |
858 Ptr<Ipv6L4Protocol> protocol = GetProtocol (ip.GetNextHeader ()); | 933 Ptr<Ipv6L4Protocol> protocol = 0;· |
934 /*GetProtocol (ip.GetNextHeader ());*/ | |
moatamri
2009/10/30 11:31:30
remove commented code and please add some comments
| |
859 | 935 |
936 Ptr<Ipv6ExtensionDemux> ipv6ExtensionDemux = m_node->GetObject<Ipv6ExtensionDe mux>(); | |
937 Ptr<Ipv6Extension> ipv6Extension = 0; | |
938 | |
939 Ipv6Address src = ip.GetSourceAddress (); | |
940 Ipv6Address dst = ip.GetDestinationAddress (); | |
941 uint8_t nextHeader = ip.GetNextHeader (); | |
942 uint8_t nextHeaderPosition = 0; | |
943 bool isDropped = false; | |
944 | |
945 if (nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP) | |
946 { | |
947 const uint8_t *buff = p->PeekData (); | |
948 | |
949 nextHeader = *buff; | |
950 nextHeaderPosition = *(buff + 1); | |
951 } | |
952 | |
953 do { | |
954 ipv6Extension = ipv6ExtensionDemux->GetExtension (nextHeader); | |
955 | |
956 if (ipv6Extension) | |
957 { | |
958 nextHeaderPosition += ipv6Extension->Process (p, nextHeaderPosition, ip, d st, &nextHeader, isDropped); | |
959 | |
960 if (isDropped) | |
961 { | |
962 return; | |
963 } | |
964 } | |
965 else | |
966 { | |
967 protocol = GetProtocol (nextHeader); | |
968 | |
969 if (!protocol) | |
970 { | |
971 NS_LOG_LOGIC ("Unknown Next Header. Drop!"); | |
972 | |
973 if (nextHeaderPosition == 0) | |
974 { | |
975 /* TODO */ | |
976 /* GetIcmpv6 ()->SendErrorParameterError (malformedPacket, dst, src, I cmpv6Header::ICMPV6_UNKNOWN_NEXT_HEADER, 40); */ | |
moatamri
2009/10/30 11:31:30
either uncomment or delete
ping67
2009/11/02 17:09:10
Done.
| |
977 } | |
978 else | |
979 { | |
980 /* TODO */ | |
981 /* GetIcmpv6 ()->SendErrorParameterError (malformedPacket, dst, src, I cmpv6Header::ICMPV6_UNKNOWN_NEXT_HEADER, ip.GetSerializedSize () + nextHeaderPos ition); */ | |
982 } | |
983 m_dropTrace (ip, p, DROP_UNKNOWN_PROTOCOL, iif); | |
984 break; | |
985 } | |
986 else | |
987 { | |
988 p->RemoveAtStart (nextHeaderPosition); | |
989 /* protocol->Receive (p, src, dst, incomingInterface); */ | |
990 ········ | |
991 /* L4 protocol */ | |
992 Ptr<Packet> copy = p->Copy (); | |
993 enum Ipv6L4Protocol::RxStatus_e status = protocol->Receive (p, ip.GetSou rceAddress (), ip.GetDestinationAddress (), GetInterface (iif)); | |
994 | |
995 switch (status) | |
996 { | |
997 case Ipv6L4Protocol::RX_OK: | |
998 break; | |
999 case Ipv6L4Protocol::RX_CSUM_FAILED: | |
1000 break; | |
1001 case Ipv6L4Protocol::RX_ENDPOINT_UNREACH: | |
1002 if (ip.GetDestinationAddress ().IsMulticast ()) | |
1003 { | |
1004 /* do not rely on multicast address */ | |
1005 break; | |
1006 } | |
1007 | |
1008 copy->AddHeader (ip); | |
1009 GetIcmpv6 ()->SendErrorDestinationUnreachable (copy, ip.GetSourceAddre ss (), Icmpv6Header::ICMPV6_PORT_UNREACHABLE); | |
1010 } | |
1011 } | |
1012 } | |
1013 } while (ipv6Extension); | |
1014 | |
1015 #if 0 | |
moatamri
2009/10/30 11:31:30
this code will be useful in the future?
ping67
2009/11/02 17:09:10
Done.
| |
860 if (protocol) | 1016 if (protocol) |
861 { | 1017 { |
862 Ptr<Packet> copy = p->Copy (); | 1018 Ptr<Packet> copy = p->Copy (); |
863 enum Ipv6L4Protocol::RxStatus_e status = protocol->Receive (p, ip.GetSourceA ddress (), ip.GetDestinationAddress (), GetInterface (iif)); | 1019 enum Ipv6L4Protocol::RxStatus_e status = protocol->Receive (p, ip.GetSourceA ddress (), ip.GetDestinationAddress (), GetInterface (iif)); |
864 | 1020 |
865 switch (status) | 1021 switch (status) |
866 { | 1022 { |
867 case Ipv6L4Protocol::RX_OK: | 1023 case Ipv6L4Protocol::RX_OK: |
868 break; | 1024 break; |
869 case Ipv6L4Protocol::RX_CSUM_FAILED: | 1025 case Ipv6L4Protocol::RX_CSUM_FAILED: |
870 break; | 1026 break; |
871 case Ipv6L4Protocol::RX_ENDPOINT_UNREACH: | 1027 case Ipv6L4Protocol::RX_ENDPOINT_UNREACH: |
872 if (ip.GetDestinationAddress ().IsMulticast ()) | 1028 if (ip.GetDestinationAddress ().IsMulticast ()) |
873 { | 1029 { |
874 /* do not rely on multicast address */ | 1030 /* do not rely on multicast address */ |
875 break; | 1031 break; |
876 } | 1032 } |
877 | 1033 |
878 copy->AddHeader (ip); | 1034 copy->AddHeader (ip); |
879 GetIcmpv6 ()->SendErrorDestinationUnreachable (copy, ip.GetSourceAddress ( ), Icmpv6Header::ICMPV6_PORT_UNREACHABLE); | 1035 GetIcmpv6 ()->SendErrorDestinationUnreachable (copy, ip.GetSourceAddress ( ), Icmpv6Header::ICMPV6_PORT_UNREACHABLE); |
880 } | 1036 } |
881 } | 1037 } |
1038 #endif | |
882 } | 1039 } |
883 | 1040 |
884 void Ipv6L3Protocol::RouteInputError (Ptr<const Packet> p, const Ipv6Header& ipH eader, Socket::SocketErrno sockErrno) | 1041 void Ipv6L3Protocol::RouteInputError (Ptr<const Packet> p, const Ipv6Header& ipH eader, Socket::SocketErrno sockErrno) |
885 { | 1042 { |
886 NS_LOG_FUNCTION (this << p << ipHeader << sockErrno); | 1043 NS_LOG_FUNCTION (this << p << ipHeader << sockErrno); |
887 NS_LOG_LOGIC ("Route input failure-- dropping packet to " << ipHeader << " wit h errno " << sockErrno); | 1044 NS_LOG_LOGIC ("Route input failure-- dropping packet to " << ipHeader << " wit h errno " << sockErrno); |
888 m_dropTrace (ipHeader, p, DROP_ROUTE_ERROR, 0); | 1045 m_dropTrace (ipHeader, p, DROP_ROUTE_ERROR, 0); |
889 } | 1046 } |
890 | 1047 |
891 Ipv6Header Ipv6L3Protocol::BuildHeader (Ipv6Address src, Ipv6Address dst, uint8_ t protocol, uint16_t payloadSize, uint8_t ttl) | 1048 Ipv6Header Ipv6L3Protocol::BuildHeader (Ipv6Address src, Ipv6Address dst, uint8_ t protocol, uint16_t payloadSize, uint8_t ttl) |
892 { | 1049 { |
893 NS_LOG_FUNCTION (this << src << dst << (uint32_t)protocol << (uint32_t)payload Size << (uint32_t)ttl); | 1050 NS_LOG_FUNCTION (this << src << dst << (uint32_t)protocol << (uint32_t)payload Size << (uint32_t)ttl); |
894 Ipv6Header hdr; | 1051 Ipv6Header hdr; |
895 | 1052 |
896 hdr.SetSourceAddress (src); | 1053 hdr.SetSourceAddress (src); |
897 hdr.SetDestinationAddress (dst); | 1054 hdr.SetDestinationAddress (dst); |
898 hdr.SetNextHeader (protocol); | 1055 hdr.SetNextHeader (protocol); |
899 hdr.SetPayloadLength (payloadSize); | 1056 hdr.SetPayloadLength (payloadSize); |
900 hdr.SetHopLimit (ttl); | 1057 hdr.SetHopLimit (ttl); |
901 return hdr; | 1058 return hdr; |
902 } | 1059 } |
903 | 1060 |
1061 void Ipv6L3Protocol::RegisterExtensions () | |
1062 { | |
1063 Ptr<Ipv6ExtensionDemux> ipv6ExtensionDemux = CreateObject<Ipv6ExtensionDemux> (); | |
1064 ipv6ExtensionDemux->SetNode (m_node); | |
1065 | |
1066 Ptr<Ipv6ExtensionHopByHop> hopbyhopExtension = CreateObject<Ipv6ExtensionHopBy Hop> (); | |
1067 hopbyhopExtension->SetNode (m_node); | |
1068 Ptr<Ipv6ExtensionDestination> destinationExtension = CreateObject<Ipv6Extensio nDestination> (); | |
1069 destinationExtension->SetNode (m_node); | |
1070 Ptr<Ipv6ExtensionFragment> fragmentExtension = CreateObject<Ipv6ExtensionFragm ent> (); | |
1071 fragmentExtension->SetNode (m_node); | |
1072 Ptr<Ipv6ExtensionRouting> routingExtension = CreateObject<Ipv6ExtensionRouting > (); | |
1073 routingExtension->SetNode (m_node); | |
1074 // Ptr<Ipv6ExtensionESP> espExtension = CreateObject<Ipv6ExtensionESP> (); | |
1075 // Ptr<Ipv6ExtensionAH> ahExtension = CreateObject<Ipv6ExtensionAH> (); | |
1076 | |
1077 ipv6ExtensionDemux->Insert (hopbyhopExtension); | |
1078 ipv6ExtensionDemux->Insert (destinationExtension); | |
1079 ipv6ExtensionDemux->Insert (fragmentExtension); | |
1080 ipv6ExtensionDemux->Insert (routingExtension); | |
1081 // ipv6ExtensionDemux->Insert (espExtension); | |
1082 // ipv6ExtensionDemux->Insert (ahExtension); | |
1083 | |
1084 Ptr<Ipv6ExtensionRoutingDemux> routingExtensionDemux = CreateObject<Ipv6Extens ionRoutingDemux> (); | |
1085 routingExtensionDemux->SetNode (m_node); | |
1086 Ptr<Ipv6ExtensionLooseRouting> looseRoutingExtension = CreateObject<Ipv6Extens ionLooseRouting> (); | |
1087 looseRoutingExtension->SetNode (m_node); | |
1088 routingExtensionDemux->Insert (looseRoutingExtension); | |
1089 | |
1090 m_node->AggregateObject (routingExtensionDemux); | |
1091 m_node->AggregateObject (ipv6ExtensionDemux); | |
1092 } | |
1093 | |
1094 void Ipv6L3Protocol::RegisterOptions () | |
1095 { | |
1096 Ptr<Ipv6OptionDemux> ipv6OptionDemux = CreateObject<Ipv6OptionDemux> (); | |
1097 ipv6OptionDemux->SetNode (m_node); | |
1098 | |
1099 Ptr<Ipv6OptionPad1> pad1Option = CreateObject<Ipv6OptionPad1> (); | |
1100 pad1Option->SetNode (m_node); | |
1101 Ptr<Ipv6OptionPadn> padnOption = CreateObject<Ipv6OptionPadn> (); | |
1102 padnOption->SetNode (m_node); | |
1103 Ptr<Ipv6OptionJumbogram> jumbogramOption = CreateObject<Ipv6OptionJumbogram> ( ); | |
1104 jumbogramOption->SetNode (m_node); | |
1105 Ptr<Ipv6OptionRouterAlert> routerAlertOption = CreateObject<Ipv6OptionRouterAl ert> (); | |
1106 routerAlertOption->SetNode (m_node); | |
1107 | |
1108 ipv6OptionDemux->Insert (pad1Option); | |
1109 ipv6OptionDemux->Insert (padnOption); | |
1110 ipv6OptionDemux->Insert (jumbogramOption); | |
1111 ipv6OptionDemux->Insert (routerAlertOption); | |
1112 | |
1113 m_node->AggregateObject (ipv6OptionDemux); | |
1114 } | |
1115 | |
904 } /* namespace ns3 */ | 1116 } /* namespace ns3 */ |
905 | 1117 |
OLD | NEW |