www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


IPsec_Store_Policy

Create a binary file containing IP Security policy and/or preshared keys.

int IPsec_Store_Policy(
        const char                   *file_name,
        const tIPSEC_POLICY_SELECTOR *selectors,
        unsigned int                  selector_count,
        const tIPSEC_POLICY_CONTENT  *contents,
        unsigned int                  content_count,
        const tIPSEC_POLICY_PAIR     *pairs,
        unsigned int                  pair_count,
        const char           * const *preshared_keys,
        unsigned int                  preshared_key_count);

Parameters

file_name

Zero terminated ASCII string specifies the path for the binary data file which will be created by this library function.

selectors

Points to an array of selector_count tIPSEC_POLICY_SELECTOR data structures to be stored in the file that is created.

selector_count

Number of data structures in array referenced by selectors.

contents

Points to an array of content_count tIPSEC_POLICY_CONTENT data structures to be stored in the file that is created.

content_count

Number of data structures in array referenced by contents.

pairs

Points to an array of pair_count tIPSEC_POLICY_PAIR data structures to be stored in the file that is created.

pair_count

Number of data structures in array referenced by pairs.

preshared_keys

Pointer to an array of ASCIIZ string pointers.   Each ASCII string specifies an IP address and preshared key using the same format as the PRESHARED_KEY entries in the CHIP.INI.

preshared_key_count

Number of pointers to zero terminated ASCII strings listed in array of pointers at preshared_keys.

Return Value

Error code:

    0 - Success, file created without problem.
    1 - Unable to create the file.
    2 - File write failed.
    3 - File exceeded 64K byte limit in size.

Comments

This function creates a binary file which can be specified in the CHIP.INI to restore IP security policies at start up or passed to the IPsec_Restore_Policy() at run time.

These policy files must not exceed 64 Kbyte size.

One reason this function has been included in the library is to provide users access to source code which creates the Beck format binary files that hold the IP security policy information, and thereby explicitly documenting this binary file's format.   (Note that the source code for these C-library functions is available from Beck.)

See Also

RTOS API

This library function uses no @Chip-RTOS API directly. Indirectly the compiler's file I/O C-library functions will access the DOS interrupt 0x21 to produce the file.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    n/an/an/aV1.07V1.00

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.06

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document