Webserver+3d print

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

oid.c File Reference

oid.c File Reference

OID (Object Identifier) More...

Go to the source code of this file.

Functions

error_t oidCheck (const uint8_t *oid, size_t oidLen)
 Check whether the specified object identifier is valid.
int_t oidComp (const uint8_t *oid1, size_t oidLen1, const uint8_t *oid2, size_t oidLen2)
 Compare object identifiers.
error_t oidEncodeSubIdentifier (uint8_t *oid, size_t maxOidLen, size_t *pos, uint32_t value)
 Encode OID sub-identifier.
error_t oidDecodeSubIdentifier (const uint8_t *oid, size_t oidLen, size_t *pos, uint32_t *value)
 Decode OID sub-identifier.
error_t oidFromString (const char_t *str, uint8_t *oid, size_t maxOidLen, size_t *oidLen)
 Convert a string representation of an OID to a binary OID.
char_t * oidToString (const uint8_t *oid, size_t oidLen, char_t *str, size_t maxStrLen)
 Convert a binary OID to a string representation.

Detailed Description

OID (Object Identifier)

License

Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneCrypto Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author:
Oryx Embedded SARL (www.oryx-embedded.com)
Version:
1.7.6

Definition in file oid.c.


Function Documentation

error_t oidCheck ( const uint8_t *  oid,
size_t  oidLen 
)

Check whether the specified object identifier is valid.

Parameters:
[in]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
Returns:
Error code

Definition at line 50 of file oid.c.

int_t oidComp ( const uint8_t *  oid1,
size_t  oidLen1,
const uint8_t *  oid2,
size_t  oidLen2 
)

Compare object identifiers.

Parameters:
[in]oid1Pointer the first OID
[in]oidLen1Length of the first OID, in bytes
[in]oid2Pointer the second OID
[in]oidLen2Length of the second OID, in bytes
Returns:
Comparison result
Return values:
0Objects identifiers are equal
-1The first OID lexicographically precedes the second OID
1The second OID lexicographically precedes the first OID

Definition at line 101 of file oid.c.

error_t oidDecodeSubIdentifier ( const uint8_t *  oid,
size_t  oidLen,
size_t *  pos,
uint32_t *  value 
)

Decode OID sub-identifier.

Parameters:
[in]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the sub-identifier
[out]valueValue of the sub-identifier
Returns:
Error code

Definition at line 182 of file oid.c.

error_t oidEncodeSubIdentifier ( uint8_t *  oid,
size_t  maxOidLen,
size_t *  pos,
uint32_t  value 
)

Encode OID sub-identifier.

Parameters:
[in]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the sub-identifier
[in]valueValue of the sub-identifier
Returns:
Error code

Definition at line 136 of file oid.c.

error_t oidFromString ( const char_t *  str,
uint8_t *  oid,
size_t  maxOidLen,
size_t *  oidLen 
)

Convert a string representation of an OID to a binary OID.

Parameters:
[in]strNULL-terminated string representing the OID
[out]oidObject identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[out]oidLenLength of the object identifier
Returns:
Error code

Definition at line 222 of file oid.c.

char_t* oidToString ( const uint8_t *  oid,
size_t  oidLen,
char_t *  str,
size_t  maxStrLen 
)

Convert a binary OID to a string representation.

Parameters:
[in]oidObject identifier
[in]oidLenLength of the object identifier, in bytes
[out]strNULL-terminated string representing the OID
[in]maxStrLenMaximum length of the resulting string
Returns:
Pointer to the formatted string

Definition at line 360 of file oid.c.