-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ovsp4rt] Extract ovsp4rt_str_to_tunnel_type() (#735)
- Moved ovsp4rt_str_to_tunnel_type() to a separate source file for C api functions that are not wrappers. Signed-off-by: Derek Foster <justffoulkes@gmail.com>
- Loading branch information
Showing
4 changed files
with
25 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2022-2025 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// ovsprt C API functions that do not have a C++ implementation. | ||
|
||
#include <string.h> | ||
|
||
#include "ovsp4rt/ovs-p4rt.h" | ||
|
||
//---------------------------------------------------------------------- | ||
// ovsp4rt_str_to_tunnel_type (common) | ||
//---------------------------------------------------------------------- | ||
enum ovs_tunnel_type ovsp4rt_str_to_tunnel_type(const char* tnl_type) { | ||
if (tnl_type) { | ||
if (strcmp(tnl_type, "vxlan") == 0) { | ||
return OVS_TUNNEL_VXLAN; | ||
} else if (strcmp(tnl_type, "geneve") == 0) { | ||
return OVS_TUNNEL_GENEVE; | ||
} | ||
} | ||
return OVS_TUNNEL_UNKNOWN; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters