00001 //--------------------------------------------------------------------------
00002 // Copyright (C) 2014-2017 Cisco and/or its affiliates. All rights reserved.
00003 //
00004 // This program is free software; you can redistribute it and/or modify it
00005 // under the terms of the GNU General Public License Version 2 as published
00006 // by the Free Software Foundation. You may not use, modify or distribute
00007 // this program under any other version of the GNU General Public License.
00008 //
00009 // This program is distributed in the hope that it will be useful, but
00010 // WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00012 // General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License along
00015 // with this program; if not, write to the Free Software Foundation, Inc.,
00016 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017 //--------------------------------------------------------------------------
00018 // codec_api.cc author Josh Rosenbaum <jrosenba@cisco.com>
00019
00020 #ifdef HAVE_CONFIG_H
00021 #include "config.h"
00022 #endif
00023
00024 #include "codec_api.h"
00025
00026 #include "framework/codec.h"
00027 #include "managers/plugin_manager.h"
00028
00029 extern const BaseApi* cd_ipv4[]; // static due to dependence on fpdetect
00030 extern const BaseApi* cd_hopopts[]; // static to ensure the symbols CheckIPV6HopOptions
00031 // and CheckIPv6ExtensionOrder the final executable.
00032 extern const BaseApi* cd_tcp[]; // static because only file that specific functions
00033 // (symbols will be removed from final executable)
00034
00035 #ifdef STATIC_CODECS
00036 extern const BaseApi* cd_ah[];
00037 extern const BaseApi* cd_arp[];
00038 extern const BaseApi* cd_ciscometadata[];
00039 extern const BaseApi* cd_dstopts[];
00040 extern const BaseApi* cd_erspan2[];
00041 extern const BaseApi* cd_erspan3[];
00042 extern const BaseApi* cd_esp[];
00043 extern const BaseApi* cd_eth[];
00044 extern const BaseApi* cd_fabricpath[];
00045 extern const BaseApi* cd_frag[];
00046 extern const BaseApi* cd_gre[];
00047 extern const BaseApi* cd_gtp[];
00048 extern const BaseApi* cd_icmp4[];
00049 extern const BaseApi* cd_icmp4_ip[];
00050 extern const BaseApi* cd_icmp6[];
00051 extern const BaseApi* cd_icmp6_ip[];
00052 extern const BaseApi* cd_ipv6[];
00053 extern const BaseApi* cd_igmp[];
00054 extern const BaseApi* cd_llc[];
00055 extern const BaseApi* cd_mobility[];
00056 extern const BaseApi* cd_mpls[];
00057 extern const BaseApi* cd_no_next[];
00058 extern const BaseApi* cd_pgm[];
00059 extern const BaseApi* cd_pppencap[];
00060 extern const BaseApi* cd_pppoepkt[];
00061 extern const BaseApi* cd_routing[];
00062 extern const BaseApi* cd_sun_nd[];
00063 extern const BaseApi* cd_swipe[];
00064 extern const BaseApi* cd_teredo[];
00065 extern const BaseApi* cd_transbridge[];
00066 extern const BaseApi* cd_udp[];
00067 extern const BaseApi* cd_user[];
00068 extern const BaseApi* cd_vlan[];
00069 #endif
00070
00071 void load_codecs()
00072 {
00073 PluginManager::load_plugins(cd_ipv4);
00074 PluginManager::load_plugins(cd_tcp);
00075 PluginManager::load_plugins(cd_hopopts);
00076
00077 #ifdef STATIC_CODECS
00078 PluginManager::load_plugins(cd_ah);
00079 PluginManager::load_plugins(cd_arp);
00080 PluginManager::load_plugins(cd_ciscometadata);
00081 PluginManager::load_plugins(cd_dstopts);
00082 PluginManager::load_plugins(cd_erspan2);
00083 PluginManager::load_plugins(cd_erspan3);
00084 PluginManager::load_plugins(cd_esp);
00085 PluginManager::load_plugins(cd_eth);
00086 PluginManager::load_plugins(cd_fabricpath);
00087 PluginManager::load_plugins(cd_frag);
00088 PluginManager::load_plugins(cd_gre);
00089 PluginManager::load_plugins(cd_gtp);
00090 PluginManager::load_plugins(cd_icmp4);
00091 PluginManager::load_plugins(cd_icmp4_ip);
00092 PluginManager::load_plugins(cd_icmp6);
00093 PluginManager::load_plugins(cd_icmp6_ip);
00094 PluginManager::load_plugins(cd_ipv6);
00095 PluginManager::load_plugins(cd_igmp);
00096 PluginManager::load_plugins(cd_llc);
00097 PluginManager::load_plugins(cd_mobility);
00098 PluginManager::load_plugins(cd_mpls);
00099 PluginManager::load_plugins(cd_no_next);
00100 PluginManager::load_plugins(cd_pgm);
00101 PluginManager::load_plugins(cd_pppencap);
00102 PluginManager::load_plugins(cd_pppoepkt);
00103 PluginManager::load_plugins(cd_routing);
00104 PluginManager::load_plugins(cd_sun_nd);
00105 PluginManager::load_plugins(cd_swipe);
00106 PluginManager::load_plugins(cd_teredo);
00107 PluginManager::load_plugins(cd_transbridge);
00108 PluginManager::load_plugins(cd_udp);
00109 PluginManager::load_plugins(cd_user);
00110 PluginManager::load_plugins(cd_vlan);
00111 #endif
00112 }
00113
END OF CODE