update userguide alignment
[samplevnf.git] / VNFs / vCGNAPT / pipeline / pipeline_cgnapt.h
1 /*
2 // Copyright (c) 2017 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16
17 #ifndef __INCLUDE_PIPELINE_CGNAPT_H__
18 #define __INCLUDE_PIPELINE_CGNAPT_H__
19
20 /**
21  * @file
22  * Pipeline CG-NAPT FE.
23  *
24  * PipelineCG-NAPT Front End (FE).
25  * Runs on the Master pipeline, responsible for CLI commands.
26  *
27  */
28
29 #include "pipeline.h"
30 #include "pipeline_cgnapt_common.h"
31
32 /**
33  * Add NAPT rule to the NAPT rule table.
34  * Both IPv4 and IPv6 rules can be added.
35  *
36  * @param app
37  *  A pointer to the pipeline app parameters.
38  * @param pipeline_id
39  *  Pipeline id
40  * @param key
41  *  A pointer to the NAPT key corresponding to the entry being added.
42  * @param entry_params
43  *  A pointer to the NAPT entry being added.
44  *
45  * @return
46  *  0 on success, negative on error.
47  */
48 #if 0
49 int
50 app_pipeline_cgnapt_add_entry(struct app_params *app,
51                                                 uint32_t pipeline_id,
52                                                 struct pipeline_cgnapt_entry_key *key,
53                                                 struct app_pipeline_cgnapt_entry_params
54                                                 *entry_params);
55 #endif
56 int app_pipeline_cgnapt_add_entry(
57         struct app_params *app,
58         uint32_t pipeline_id,
59         struct app_pipeline_cgnapt_entry_params *entry_params);
60 /**
61  * Delete NAPT rule from the NAPT rule table.
62  * Both IPv4 and IPv6 rules can be added.
63  *
64  * @param app
65  *  A pointer to the pipeline app parameters.
66  * @param pipeline_id
67  *  Pipeline id
68  * @param key
69  *  A pointer to the NAPT key corresponding to the entry being added.
70  *
71  * @return
72  *  0 on success, negative on error.
73  */
74 int
75 app_pipeline_cgnapt_delete_entry(struct app_params *app,
76                                  uint32_t pipeline_id,
77                                  struct pipeline_cgnapt_entry_key *key);
78
79 /**
80  * Add multiple NAPT rule to the NAPT rule table.
81  * Both IPv4 and IPv6 rules can be added.
82  *
83  * @param app
84  *  A pointer to the pipeline app parameters.
85  * @param pipeline_id
86  *  Pipeline id
87  * @param entry_params
88  *  A pointer to the multiple NAPT entry params being added.
89  *
90  * @return
91  *  0 on success, negative on error.
92  */
93 int app_pipeline_cgnapt_addm_entry(struct app_params *app, uint32_t pipeline_id,
94                                                 struct app_pipeline_cgnapt_mentry_params
95                                          *entry_params);
96
97 /**
98  * Add Network Specific Prefix for NAT64.
99  *
100  * @param app
101  *  A pointer to the pipeline app parameters.
102  * @param pipeline_id
103  *  Pipeline id
104  * @param nsp
105  *  A pointer to NSP being added.
106  *
107  * @return
108  *  0 on success, negative on error.
109  */
110 int
111 app_pipeline_cgnapt_nsp_add_entry(struct app_params *app,
112                                         uint32_t pipeline_id,
113                                         struct pipeline_cgnapt_nsp_t *nsp);
114
115 /**
116  * Delete a Network Specific Prefix for NAT64.
117  *
118  * @param app
119  *  A pointer to the pipeline app parameters.
120  * @param pipeline_id
121  *  Pipeline id
122  * @param nsp
123  *  A pointer to NSP being deleted.
124  *
125  * @return
126  *  0 on success, negative on error.
127  */
128 int
129 app_pipeline_cgnapt_nsp_del_entry(struct app_params *app,
130                                         uint32_t pipeline_id,
131                                         struct pipeline_cgnapt_nsp_t *nsp);
132
133 /*
134  * Pipeline type
135  */
136 extern struct pipeline_type pipeline_cgnapt;
137
138 #endif