-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added skeleton IPSec Accelerator extern
Signed-off-by: Rupesh Chiluka <[email protected]>
- Loading branch information
1 parent
005c6cf
commit 4cd9a6f
Showing
4 changed files
with
110 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,53 @@ | ||
/* Copyright 2024 Marvell Technology, Inc. | ||
* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* Rupesh Chiluka ([email protected]) | ||
* | ||
*/ | ||
|
||
#include "pna_ipsec_accelerator.h" | ||
|
||
namespace bm { | ||
|
||
namespace pna { | ||
|
||
void PNA_IpsecAccelerator::init() { | ||
} | ||
|
||
void PNA_IpsecAccelerator::set_sa_index(const Data &sa_index) { | ||
std::cout << "sa_index: " << sa_index.get<uint32_t>() << std::endl; | ||
} | ||
|
||
void PNA_IpsecAccelerator::enable() { | ||
_is_enabled = true; | ||
} | ||
|
||
void PNA_IpsecAccelerator::disable() { | ||
_is_enabled = false; | ||
} | ||
|
||
BM_REGISTER_EXTERN_W_NAME(ipsec_accelerator, PNA_IpsecAccelerator); | ||
BM_REGISTER_EXTERN_W_NAME_METHOD(ipsec_accelerator, PNA_IpsecAccelerator, set_sa_index, const Data &); | ||
BM_REGISTER_EXTERN_W_NAME_METHOD(ipsec_accelerator, PNA_IpsecAccelerator, enable); | ||
BM_REGISTER_EXTERN_W_NAME_METHOD(ipsec_accelerator, PNA_IpsecAccelerator, disable); | ||
|
||
} // namespace bm::pna | ||
|
||
} // namespace bm | ||
|
||
int import_ipsec_accelerator() { | ||
return 0; | ||
} |
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,54 @@ | ||
/* Copyright 2024 Marvell Technology, Inc. | ||
* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* Rupesh Chiluka ([email protected]) | ||
* | ||
*/ | ||
|
||
#ifndef PNA_NIC_PNA_IPSECACCELERATOR_H_ | ||
#define PNA_NIC_PNA_IPSECACCELERATOR_H_ | ||
|
||
#include <bm/bm_sim/extern.h> | ||
|
||
namespace bm { | ||
|
||
namespace pna { | ||
|
||
class PNA_IpsecAccelerator : public bm::ExternType { | ||
public: | ||
|
||
BM_EXTERN_ATTRIBUTES { | ||
} | ||
|
||
void init() override; | ||
|
||
void set_sa_index(const Data &sa_index); | ||
|
||
void enable(); | ||
|
||
void disable(); | ||
|
||
private: | ||
uint32_t _sa_index; | ||
bool _is_enabled; | ||
|
||
}; | ||
|
||
} // namespace bm::pna | ||
|
||
} // namespace bm | ||
|
||
#endif // PNA_NIC_PNA_IPSECACCELERATOR_H_ |
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