Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.13.1.2
openapi_transfer.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2016-2024 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_transfer.h
28 *
29 * @purpose Transfer Download
30 *
31 * @component OpEN
32 *
33 * @create 2/18/2016
34 *
35 * @end
36 *
37 **********************************************************************/
38 #ifndef OPENAPI_TRANSFER_H_INCLUDED
39 #define OPENAPI_TRANSFER_H_INCLUDED
40 
41 #include "openapi_common.h"
42 
44 typedef enum
45 {
59 
61 typedef enum
62 {
113 
115 typedef enum
116 {
117  OPEN_NO_STATUS_CHANGE = 1,
118  OPEN_STATUS_CHANGED = 2,
119  OPEN_TRANSFER_FAILED = 3,
120  OPEN_TRANSFER_BAD_CRC = 4,
121  OPEN_FLASH_FAILED = 5,
122  OPEN_OPR_FILE_TYPE_FAILED = 6,
123  OPEN_OTHER_FILE_TYPE_FAILED = 7,
124  OPEN_NEXT_DATA_BLOCK_RECEIVED = 8,
125  OPEN_TRANSFER_FILE_NOT_FOUND = 9,
126  OPEN_TRANSFER_SUCCESS = 10,
127  OPEN_TFTP_FAILED = 11,
128  OPEN_OPR_FILE_VERSION_FAILED = 12,
129  OPEN_DIGITAL_SIGNATURE_VERIFY_FAILED = 13,
130  OPEN_DIGITAL_SIGNATURE_TRUNCATE_FAILED = 14,
131  OPEN_TRANSFER_STATUS_LAST = 15
133 
135 typedef enum
136 {
137  OPEN_TRANSFER_CODE_NONE = 0,
138  OPEN_TRANSFER_CODE_STARTING = 1,
139  OPEN_TRANSFER_CODE_ERROR_STARTING = 2,
140  OPEN_TRANSFER_CODE_WRONG_FILE_TYPE = 3,
141  OPEN_TRANSFER_CODE_UPDATE_CONFIG = 4,
142  OPEN_TRANSFER_CODE_INVALID_CONFIG = 5,
143  OPEN_TRANSFER_CODE_WRITING_FLASH = 6,
144  OPEN_TRANSFER_CODE_FLASH_FAILED = 7,
145  OPEN_TRANSFER_CODE_CHECKING_CRC = 8,
146  OPEN_TRANSFER_CODE_CRC_FAILURE = 9,
147  OPEN_TRANSFER_CODE_UNKNOWN_DIRECTION = 10,
148  OPEN_TRANSFER_CODE_SUCCESS = 11,
149  OPEN_TRANSFER_CODE_FAILURE = 12,
150  OPEN_TRANSFER_CODE_WRONG_DEVICE = 13,
151  OPEN_TRANSFER_CODE_INSUFFICIENT_MEMORY = 14,
152  OPEN_TRANSFER_CODE_FLASH_FILE_OPEN_FAIL = 15,
153  OPEN_TRANSFER_CODE_ERROR_READING_FROM_FLASH = 16,
154  OPEN_TRANSFER_CODE_FILE_DOES_NOT_EXISTS = 17,
155  OPEN_TRANSFER_CODE_FILE_TOO_BIG = 18,
156  OPEN_TRANSFER_CODE_ERROR_WRITING_TO_FLASH = 19,
157  OPEN_TRANSFER_CODE_OVERWRITE_DENIED = 20,
158  OPEN_TRANSFER_CODE_LAST = 21
160 
162 typedef enum
163 {
170 
172 typedef enum
173 {
179 
180 /*****************************************************************/
193  uint32_t *headerSize);
194 
195 /*****************************************************************/
221  open_buffdesc *headerData,
222  OPEN_BOOL_t *isValid);
223 
224 /*****************************************************************/
239  OPEN_TRANSFER_MODES_t *xfrMode);
240 
241 /*****************************************************************/
256  OPEN_TRANSFER_MODES_t xfrMode);
257 
258 /*****************************************************************/
276  OPEN_FILE_TYPES_t *fileType);
277 
278 /*****************************************************************/
297  OPEN_FILE_TYPES_t fileType);
298 
299 /*****************************************************************/
313  uint32_t serverPort);
314 
315 /*****************************************************************/
332  uint32_t *serverPort);
333 
334 /*****************************************************************/
348  OPEN_FILE_TYPES_t *pFileType);
349 
350 /*****************************************************************/
374  OPEN_FILE_TYPES_t fileType);
375 
376 /*****************************************************************/
391  OPEN_FILE_TYPES_t *pFileType);
392 
393 /*****************************************************************/
408  OPEN_FILE_TYPES_t fileType);
409 
410 /*****************************************************************/
425  open_inet_addr_t *inetAddr);
426 
427 /*****************************************************************/
445  open_inet_addr_t inetAddr);
446 
447 /*****************************************************************/
468  open_buffdesc *filePath,
469  open_buffdesc *fileName);
470 
471 /*****************************************************************/
492  open_buffdesc *filePath,
493  open_buffdesc *fileName);
494 
495 /*****************************************************************/
515  open_buffdesc *imageLabel);
516 
517 /*****************************************************************/
541  open_buffdesc *imageLabel);
542 
543 /*****************************************************************/
565  open_buffdesc *username,
566  open_buffdesc *password);
567 
568 /*****************************************************************/
590  open_buffdesc *username,
591  open_buffdesc *password);
592 
593 /*****************************************************************/
621  open_buffdesc *filePathBuf,
622  open_buffdesc *fileNameBuf);
623 
624 /*****************************************************************/
641 
642 /*****************************************************************/
657  OPEN_BOOL_t *isInProgress);
658 
659 /*****************************************************************/
678  OPEN_TRANSFER_STATUS_t *resultCode,
679  open_buffdesc *resultStatus);
680 
681 /*****************************************************************/
698 
699 /*****************************************************************/
714  OPEN_TRANSFER_CODE_t *resultCode);
715 
716 /*****************************************************************/
731  OPEN_DIGITAL_SIGNATURE_OPTION_t *dsvConfigOption);
732 
733 /*****************************************************************/
748  OPEN_DIGITAL_SIGNATURE_OPTION_t dsvConfigOption);
749 
750 /*****************************************************************/
767  OPEN_COPY_CONFIG_DIRECTIVE_t directive);
768 
769 /*********************************************************************************/
788  uint32_t licenseIndex);
789 
790 /*****************************************************************/
808  uint32_t unit,
809  open_buffdesc *srcFileName,
810  open_buffdesc *dstFileName);
811 
812 /*********************************************************************************/
832  uint32_t usbNumber);
833 
834 /*********************************************************************************/
854  uint32_t *usbNumber);
855 
856 #endif /* OPENAPI_TRANSFER_H_INCLUDED */
857 
open_error_t openapiTransferUploadFileTypeGet(openapiClientHandle_t *client_handle, OPEN_FILE_TYPES_t *pFileType)
Get the Transfer upload File Type.
open_error_t openapiTransferUsbDeviceNumberSet(openapiClientHandle_t *client_handle, uint32_t usbNumber)
This API sets the USB Device number for transfer operation.
open_error_t openapiHttpTransferDownStartSet(openapiClientHandle_t *client_handle, open_buffdesc *filePathBuf, open_buffdesc *fileNameBuf)
Completes an HTTP(S) file download transfer operation.
Digital Signature verify for all downloads.
open_error_t openapiFileCopy(openapiClientHandle_t *client_handle, uint32_t unit, open_buffdesc *srcFileName, open_buffdesc *dstFileName)
copies a given local file locally or remotely
open_error_t openapiTransferUpStartSet(openapiClientHandle_t *client_handle)
Starts an asynchronous file upload transfer operation.
open_error_t openapiTransferUploadFileTypeSet(openapiClientHandle_t *client_handle, OPEN_FILE_TYPES_t fileType)
Set the Transfer upload File Type.
open_error_t openapiTransferLicenseIndexSet(openapiClientHandle_t *client_handle, uint32_t licenseIndex)
This API sets the index of the License file, that is to be transferred by the system.
OPEN_FILE_TYPES_t
OPEN File Types.
Digital Signature verify for Image download only.
OPEN_COPY_CONFIG_DIRECTIVE_t
OPEN Configuration File Copy Combinations.
Invalid file type.
DHCP Client configuration files.
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiTransferDownloadResultCodeGet(openapiClientHandle_t *client_handle, OPEN_TRANSFER_CODE_t *resultCode)
To retrieve the status of a transfer operation.
Transfer via ZMODEM.
open_error_t openapiDigitalSignatureVerifyConfigSet(openapiClientHandle_t *client_handle, OPEN_DIGITAL_SIGNATURE_OPTION_t dsvConfigOption)
To set the option to verify digital signature of downloaded file.
Transfer via FTP.
Backup Configuration file.
open_error_t openapiTransferFileTypeGet(openapiClientHandle_t *client_handle, OPEN_FILE_TYPES_t *fileType)
Get the Transfer File Type.
open_error_t openapiTransferServerAddressGet(openapiClientHandle_t *client_handle, open_inet_addr_t *inetAddr)
Get the transfer server address.
OPEN_TRANSFER_MODES_t
OPEN File Transfer Types.
Client SSL Certificate.
open_error_t openapiDigitalSignatureVerifyConfigGet(openapiClientHandle_t *client_handle, OPEN_DIGITAL_SIGNATURE_OPTION_t *dsvConfigOption)
To get the option to verify digital signature of downloaded file.
Transfer via sftp.
"startup-config" to "backup-config"
Text Configuration.
Openflow Switch Certificate file.
"running-config" to "startup-config"
TRO69 Client SSL Certificate.
Reference configuration file.
All persistent log files.
Digital Signature verify for config script download only.
open_error_t openapiTransferServerPortGet(openapiClientHandle_t *client_handle, uint32_t *serverPort)
Get the Server port used for Transfer.
open_error_t openapiTransferFileRemoteSet(openapiClientHandle_t *client_handle, open_buffdesc *filePath, open_buffdesc *fileName)
Set the path and name of the file on the remote system that is designated for transfer.
open_error_t openapiTransferModeGet(openapiClientHandle_t *client_handle, OPEN_TRANSFER_MODES_t *xfrMode)
Get the current transfer mode.
OPEN_TRANSFER_CODE_t
OPEN File Transfer Code.
open_error_t openapiTransferDownloadFileTypeGet(openapiClientHandle_t *client_handle, OPEN_FILE_TYPES_t *pFileType)
Get the Transfer Download File Type.
For bounds checking.
open_error_t openapiTransferInProgressGet(openapiClientHandle_t *client_handle, OPEN_BOOL_t *isInProgress)
Retrieve the progress of a file transfer.
Openflow Private Key file.
open_error_t openapiTransferServerPortSet(openapiClientHandle_t *client_handle, uint32_t serverPort)
Set the Server port used for Transfer.
open_error_t openapiTransferFileRemoteGet(openapiClientHandle_t *client_handle, open_buffdesc *filePath, open_buffdesc *fileName)
Get the path and name of the file on the remote system that is designated for transfer.
For bounds checking.
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
open_error_t openapiTransferRemoteUserCredentialsSet(openapiClientHandle_t *client_handle, open_buffdesc *username, open_buffdesc *password)
Set the credentials (username and password) of remote host that will serve the file during the transf...
Invalid xfer type.
Openflow CA Certificate file.
open_error_t openapiTransferServerAddressSet(openapiClientHandle_t *client_handle, open_inet_addr_t inetAddr)
Set the transfer server address.
Compressed executable.
open_error_t openapiTransferUsbDeviceNumberGet(openapiClientHandle_t *client_handle, uint32_t *usbNumber)
This API gets the USB Device number for transfer operation.
No Digital Signature verify for all downloads.
Configuration file.
Transfer via https.
Transfer via http.
Transfer via USB.
open_error_t openapiTransferRemoteUserCredentialsGet(openapiClientHandle_t *client_handle, open_buffdesc *username, open_buffdesc *password)
Get the credentials (username and password) of remote host that will serve the file during the transf...
open_error_t openapiTransferResultGet(openapiClientHandle_t *client_handle, OPEN_TRANSFER_STATUS_t *resultCode, open_buffdesc *resultStatus)
To retrieve the status of a transfer task in string format.
Transfer via tftp.
SSL PEM Root Certificate.
open_error_t openapiImageHeaderCheck(openapiClientHandle_t *client_handle, open_buffdesc *headerData, OPEN_BOOL_t *isValid)
Test an image file header to determine if it is appropriate for this device.
open_error_t openapiTransferFileLocalGet(openapiClientHandle_t *client_handle, open_buffdesc *imageLabel)
Get the label by which the file to be transferred is known by on the local system.
OPEN_DIGITAL_SIGNATURE_OPTION_t
OPEN Image Verification Options.
open_error_t openapiTransferDownloadFileTypeSet(openapiClientHandle_t *client_handle, OPEN_FILE_TYPES_t fileType)
Set the Transfer Download File Type.
open_error_t openapiImageHeaderSizeGet(openapiClientHandle_t *client_handle, uint32_t *headerSize)
Determine the size the image file header for this device.
open_error_t openapiTransferModeSet(openapiClientHandle_t *client_handle, OPEN_TRANSFER_MODES_t xfrMode)
Set the current transfer mode.
"backup-config" to "startup-config"
Transfer via YMODEM.
SSL PEM Server Certificate.
"running-config" to "factory-default"
open_error_t openapiCopyConfigFile(openapiClientHandle_t *client_handle, OPEN_COPY_CONFIG_DIRECTIVE_t directive)
This API copies configuration files that are located on the switch.
OPEN_TRANSFER_STATUS_t
OPEN File Transfer Status.
Transfer via XMODEM.
open_error_t openapiTransferFileTypeSet(openapiClientHandle_t *client_handle, OPEN_FILE_TYPES_t fileType)
Set the Transfer File Type.
Transfer via scp.
open_error_t openapiTransferDownStartSet(openapiClientHandle_t *client_handle)
Starts an asynchronous file download transfer operation.
Public Key Configuration.
open_error_t openapiTransferFileLocalSet(openapiClientHandle_t *client_handle, open_buffdesc *imageLabel)
Set the label by which the file to be transferred is known by on the local system.