blob: d370ddeeee499e250961f53e95f6b5ffb9ce4c32 [file] [log] [blame]
John Lo7f358b32018-04-28 01:19:24 -04001/*
Paul Vinciguerra5b755e22019-10-26 19:34:40 -04002 * ip_neighbor.h: ip neighbor generic services
John Lo7f358b32018-04-28 01:19:24 -04003 *
4 * Copyright (c) 2018 Cisco and/or its affiliates.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef included_ip_neighbor_h
19#define included_ip_neighbor_h
20
21#define IP_SCAN_DISABLED 0
22#define IP_SCAN_V4_NEIGHBORS (1 << 0)
23#define IP_SCAN_V6_NEIGHBORS (1 << 1)
24#define IP_SCAN_V46_NEIGHBORS (IP_SCAN_V4_NEIGHBORS | IP_SCAN_V6_NEIGHBORS)
25
26typedef struct
27{
28 u8 mode; /* 0: disable, 1: ip4, 2: ip6, 3: both */
29 u8 scan_interval; /* neighbor scan interval in minutes */
30 u8 max_proc_time; /* max processing time per run, in usecs */
31 u8 max_update; /* max probe/delete operations per run */
32 u8 scan_int_delay; /* delay in msecs, to resume scan on max */
Paul Vinciguerra5b755e22019-10-26 19:34:40 -040033 u8 stale_threshold; /* Threshold in minutes to delete nei entry */
John Lo7f358b32018-04-28 01:19:24 -040034} ip_neighbor_scan_arg_t;
35
36void ip_neighbor_scan_enable_disable (ip_neighbor_scan_arg_t * arg);
37
Neale Ranns0bdd3192018-09-07 11:04:52 -070038typedef enum ip_neighbor_flags_t_
39{
Neale Ranns37029302018-08-10 05:30:06 -070040 IP_NEIGHBOR_FLAG_NONE = 0,
Neale Ranns0bdd3192018-09-07 11:04:52 -070041 IP_NEIGHBOR_FLAG_STATIC = (1 << 0),
Neale Ranns37029302018-08-10 05:30:06 -070042 IP_NEIGHBOR_FLAG_DYNAMIC = (1 << 1),
43 IP_NEIGHBOR_FLAG_NO_FIB_ENTRY = (1 << 2),
44} __attribute__ ((packed)) ip_neighbor_flags_t;
45
46extern u8 *format_ip_neighbor_flags (u8 * s, va_list * args);
Neale Ranns0bdd3192018-09-07 11:04:52 -070047
48extern int ip_neighbor_add (const ip46_address_t * ip,
Neale Ranns37029302018-08-10 05:30:06 -070049 ip46_type_t type,
50 const mac_address_t * mac,
Neale Ranns14260392018-09-28 05:00:57 -070051 u32 sw_if_index,
52 ip_neighbor_flags_t flags, u32 * stats_index);
Neale Ranns0bdd3192018-09-07 11:04:52 -070053
54extern int ip_neighbor_del (const ip46_address_t * ip,
Neale Ranns37029302018-08-10 05:30:06 -070055 ip46_type_t type, u32 sw_if_index);
Neale Ranns0bdd3192018-09-07 11:04:52 -070056
John Lo7f358b32018-04-28 01:19:24 -040057#endif /* included_ip_neighbor_h */
58
59/*
60 * fd.io coding-style-patch-verification: ON
61 *
62 * Local Variables:
63 * eval: (c-set-style "gnu")
64 * End:
65 */