Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.9.0.2
Welcome
ADK Documentation
API Reference
Files
File List
Globals
api
include
openapi_ssh.h
Go to the documentation of this file.
1
9
/*********************************************************************
10
*
11
* Copyright 2016-2022 Broadcom.
12
*
13
* Licensed under the Apache License, Version 2.0 (the "License");
14
* you may not use this file except in compliance with the License.
15
* You may obtain a copy of the License at
16
*
17
* http://www.apache.org/licenses/LICENSE-2.0
18
*
19
* Unless required by applicable law or agreed to in writing, software
20
* distributed under the License is distributed on an "AS IS" BASIS,
21
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
* See the License for the specific language governing permissions and
23
* limitations under the License.
24
*
25
**********************************************************************
26
*
27
* @filename openapi_ssh.h
28
*
29
* @purpose SSH Configuration and Status
30
*
31
* @component OpEN
32
*
33
* @create 30/01/2013
34
*
35
* @end
36
*
37
**********************************************************************/
38
#ifndef OPENAPI_SSH_H_INCLUDED
39
#define OPENAPI_SSH_H_INCLUDED
40
41
#include "
openapi_common.h
"
42
#include "
openapi_logging.h
"
43
#include "
openapi_transfer.h
"
44
46
typedef
enum
47
{
48
OPEN_SSH_KEY_TYPE_RSA
= 0,
49
OPEN_SSH_KEY_TYPE_DSA
= 1,
50
OPEN_SSH_KEY_TYPE_ECDSA
= 2
51
}
OPEN_SSH_KEY_TYPE_t
;
52
54
typedef
enum
55
{
56
OPEN_SSH_PROTO_VERSION_1 = 0,
/* SSH Protocol Version 1 option not supported */
57
OPEN_SSH_PROTO_VERSION_2
= 1,
58
OPEN_SSH_PROTO_VERSION_BOTH
= 2
59
}
OPEN_SSH_PROTO_VERSION_t
;
60
61
typedef
enum
62
{
63
OPEN_SCP_OPER_NONE = 0,
64
OPEN_SCP_PUSH = 1,
65
OPEN_SCP_PULL = 2
66
} OPEN_SCP_OPER_t;
67
68
/*****************************************************************/
87
open_error_t
openapiSSHKeyGenerate
(
openapiClientHandle_t
*client_handle,
88
OPEN_SSH_KEY_TYPE_t
sshKeyType);
89
90
/*****************************************************************/
107
open_error_t
openapiSSHKeyDelete
(
openapiClientHandle_t
*client_handle,
108
OPEN_SSH_KEY_TYPE_t
sshKeyType);
109
110
/*****************************************************************/
129
open_error_t
openapiSSHAdminModeSet
(
openapiClientHandle_t
*client_handle,
130
OPEN_CONTROL_t
sshAdminMode);
131
132
/*****************************************************************/
147
open_error_t
openapiSSHAdminModeGet
(
openapiClientHandle_t
*client_handle,
148
OPEN_CONTROL_t
*sshAdminMode);
149
150
/*****************************************************************/
169
open_error_t
openapiSSHProtocolVersionSet
(
openapiClientHandle_t
*client_handle,
170
OPEN_SSH_PROTO_VERSION_t
protoVersion);
171
172
/*****************************************************************/
184
open_error_t
openapiSSHProtocolVersionGet
(
openapiClientHandle_t
*client_handle,
185
OPEN_SSH_PROTO_VERSION_t
*protoVersion);
186
187
/*****************************************************************/
204
open_error_t
openapiSSHSessionTimeoutSet
(
openapiClientHandle_t
*client_handle,
205
uint32_t sshSessionTimeout);
206
207
/*****************************************************************/
220
open_error_t
openapiSSHSessionTimeoutGet
(
openapiClientHandle_t
*client_handle,
221
uint32_t *sshSessionTimeout);
222
223
/*****************************************************************/
240
open_error_t
openapiSSHMaxSessionsSet
(
openapiClientHandle_t
*client_handle,
241
uint32_t sshMaxSessions);
242
243
/*****************************************************************/
257
open_error_t
openapiSSHMaxSessionsDefaultSet
(
openapiClientHandle_t
*client_handle);
258
259
/*****************************************************************/
271
open_error_t
openapiSSHMaxSessionsGet
(
openapiClientHandle_t
*client_handle,
272
uint32_t *sshMaxSessions);
273
274
/*****************************************************************/
287
open_error_t
openapiSSHActiveSessionsGet
(
openapiClientHandle_t
*client_handle,
288
uint32_t *sshActiveSessions);
289
290
/*****************************************************************/
303
open_error_t
openapiSSHSocketInfoClear
(
openapiClientHandle_t
*client_handle,
304
uint32_t sshClientID);
305
306
/*****************************************************************/
323
open_error_t
openapiSSHKeyStatusGet
(
openapiClientHandle_t
*client_handle,
324
OPEN_SSH_KEY_TYPE_t
sshKeyType);
325
326
/*****************************************************************/
344
open_error_t
openapiSSHUserAuthenticate
(
openapiClientHandle_t
*client_handle,
345
open_buffdesc
*userName,
open_buffdesc
*password,
346
open_buffdesc
*ipAddr, uint32_t sshClientID);
347
348
/*****************************************************************/
365
open_error_t
openapiSSHPublicUserAuthenticate
(
openapiClientHandle_t
*client_handle,
366
open_buffdesc
*userName,
open_buffdesc
*ipAddr,
367
uint32_t sshClientID);
368
369
/*****************************************************************/
384
open_error_t
openapiSSHPubKeyAuthModeGet
(
openapiClientHandle_t
*client_handle,
385
OPEN_CONTROL_t
*sshdPubKeyAuthMode);
386
387
/*****************************************************************/
404
open_error_t
openapiSSHPubKeyGet
(
openapiClientHandle_t
*client_handle,
405
OPEN_SSH_KEY_TYPE_t
sshKeyType,
406
open_buffdesc
*userName,
407
open_buffdesc
*pubKey);
408
409
/*****************************************************************/
424
open_error_t
openapiSSHLogMessage
(
openapiClientHandle_t
*client_handle,
425
OPEN_LOG_SEVERITY_t
severity,
open_buffdesc
*fileName,
426
uint32_t lineNum,
open_buffdesc
*msgBuf);
427
428
429
/*****************************************************************/
442
open_error_t
openapiSSHTransferRemotePasswordFromUserGet
(
openapiClientHandle_t
*client_handle,
443
open_buffdesc
*userName,
444
open_buffdesc
*password);
445
446
/*****************************************************************/
462
open_error_t
openapiSSHRemotePasswordGet
(
openapiClientHandle_t
*client_handle,
463
uint32_t clientSockID,
464
open_buffdesc
*password);
465
466
/*****************************************************************/
482
open_error_t
openapiScpServerAdminModeSet
(
openapiClientHandle_t
*client_handle,
483
OPEN_CONTROL_t
scpServerAdminMode);
484
485
/*****************************************************************/
501
open_error_t
openapiScpServerAdminModeGet
(
openapiClientHandle_t
*client_handle,
502
OPEN_CONTROL_t
*scpServerAdminMode);
503
504
/*****************************************************************/
539
open_error_t
openapiScpRemoteTransferStart
(
openapiClientHandle_t
*client_handle,
540
int32_t scpClientPID,
541
open_buffdesc
*fileParams);
542
543
/*****************************************************************/
561
open_error_t
openapiScpRemoteTransferComplete
(
openapiClientHandle_t
*client_handle);
562
563
/*********************************************************************
564
* @purpose To get passphrase for SSH key decryption.
565
*
566
* @param[in] client_handle Client handle from registration API.
567
* @param[in] sshKeyType SSH host key type
568
* @param[out] bufPassphrase Buffer for passphrase
569
*
570
* @returns OPEN_E_NONE if successfully updated status.
571
* @returns OPEN_E_PARAM if invalid input parameters is passed.
572
* @returns OPEN_E_ERROR if failed to get passphrase.
573
*
574
* @note This OpEN API returns the passphrase used to decrypt the SSH host key
575
* in plain-text. Usage of this API is not recommended as this can
576
* be a security concern.
577
*
578
* @open-status-hidden
579
*
580
* @supportedinversion OpEN API Version: 1.21
581
*
582
* @end
583
*********************************************************************/
584
open_error_t
openapiSSHKeyEncryptPassphraseGet(
openapiClientHandle_t
*client_handle,
585
OPEN_SSH_KEY_TYPE_t
sshKeyType,
586
open_buffdesc
*bufPassphrase);
587
/*****************************************************************/
623
open_error_t
openapiScpRemoteTransferUploadStart
(
openapiClientHandle_t
*client_handle,
624
int32_t scpClientPID,
625
open_buffdesc
*fileParams);
626
627
/*****************************************************************/
642
open_error_t
openapiScpTransferRemoteComplete
(
openapiClientHandle_t
*client_handle,
643
OPEN_TRANSFER_STATUS_t
transferStatus,
644
OPEN_SCP_OPER_t transferType);
645
646
/*****************************************************************/
659
open_error_t
openapiScpTransferStatusSet
(
openapiClientHandle_t
*client_handle);
660
661
/*****************************************************************/
675
open_error_t
openapiSSHTaskCleanup
(
openapiClientHandle_t
*client_handle);
676
677
#endif
678
© 2022 by Broadcom. All rights reserved.