-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added npcap_helpers passthrough to API (#8)
- Loading branch information
1 parent
f2e7c90
commit 5f511fb
Showing
4 changed files
with
100 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2024 Continental Corporation | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
// IWYU pragma: begin_exports | ||
#include <ecaludp/ecaludp_export.h> | ||
// IWYU pragma: end_exports | ||
|
||
namespace ecaludp | ||
{ | ||
namespace npcap | ||
{ | ||
/** | ||
* @brief Initializes Npcap, if not done already. Must be called before calling any native npcap methods. | ||
* | ||
* This method initialized Npcap and must be called at least once before | ||
* calling any ncap functions. | ||
* As it always returns true when npcap has been intialized successfully, it | ||
* can also be used to check whether npcap is available and working properly. | ||
* | ||
* If this function returns true, npcap should work. | ||
* | ||
* @return True if npcap is working | ||
*/ | ||
ECALUDP_EXPORT bool initialize(); | ||
|
||
/** | ||
* @brief Checks whether npcap has been initialized successfully | ||
* @return true if npcap has been initialized successfully | ||
*/ | ||
ECALUDP_EXPORT bool is_initialized(); | ||
|
||
/** | ||
* @brief Returns a human readible status message. | ||
* | ||
* This message is intended to be displayed in a graphical user interface. | ||
* For terminal based applications it is not needed, as the messages are also | ||
* printed to stderr. | ||
* | ||
* @return The Udpcap status as human-readible text (may be multi-line) | ||
*/ | ||
ECALUDP_EXPORT std::string get_human_readable_error_text(); | ||
} | ||
} |
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,34 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2024 Continental Corporation | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
#pragma once | ||
|
||
#include <ecaludp/npcap_helpers.h> | ||
|
||
#include <string> | ||
|
||
#include <udpcap/npcap_helpers.h> | ||
|
||
namespace ecaludp | ||
{ | ||
namespace npcap | ||
{ | ||
bool initialize() { return Udpcap::Initialize(); } | ||
|
||
bool is_initialized() { return Udpcap::IsInitialized(); } | ||
|
||
std::string get_human_readable_error_text() { return Udpcap::GetHumanReadibleErrorText(); } | ||
} | ||
} |
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