summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/hicn_plugin.c
blob: 5f28f01232f557e137515c4796ec55dd5d1135c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
 * Copyright (c) 2017-2019 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <vnet/vnet.h>
#include <vnet/plugin/plugin.h>
#include <vlib/vlib.h>

#include <vpp_plugins/hicn/error.h>

#include "network/hicn.h"
#include "network/params.h"
#include "network/infra.h"
#include "network/strategy_dpo_manager.h"
#include "network/mgmt.h"
#include "network/faces/app/address_mgr.h"
#include "network/face_db.h"
#include "network/udp_tunnels/udp_tunnel.h"
#include "network/route.h"
#include "host_stack/host_stack.h"

/*
 * Init entry-point for the icn plugin
 */
static clib_error_t *
hicn_init(vlib_main_t *vm)
{
  clib_error_t *error = 0;

  hicn_main_t *sm = &hicn_main;

  /* Init other elements in the 'main' struct */
  sm->is_enabled = 0;

  error = hicn_api_plugin_hookup(vm);

  /* Init the dpo module */
  hicn_dpos_init();

  /* Init the app manager */
  address_mgr_init();

  hicn_face_module_init(vm);

  /* Init the route module */
  hicn_route_init();

  udp_tunnel_init();

  /* Init the host stack module */
  hicn_hs_init(vm);

  return error;
}

VLIB_INIT_FUNCTION(hicn_init);

/* *INDENT-OFF* */
VLIB_PLUGIN_REGISTER() =
    {
        .description = "hICN network/transport/session plugin"};
/* *INDENT-ON* */

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables: eval: (c-set-style "gnu") End:
 */