Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lwip_snmpv3_priv.h Source File

lwip_snmpv3_priv.h

Go to the documentation of this file.
00001 /**
00002  * @file
00003  * Additional SNMPv3 functionality RFC3414 and RFC3826 (internal API, do not use in client code).
00004  */
00005 
00006 /*
00007  * Copyright (c) 2016 Elias Oenal.
00008  * All rights reserved.
00009  *
00010  * Redistribution and use in source and binary forms, with or without modification,
00011  * are permitted provided that the following conditions are met:
00012  *
00013  * 1. Redistributions of source code must retain the above copyright notice,
00014  *    this list of conditions and the following disclaimer.
00015  * 2. Redistributions in binary form must reproduce the above copyright notice,
00016  *    this list of conditions and the following disclaimer in the documentation
00017  *    and/or other materials provided with the distribution.
00018  * 3. The name of the author may not be used to endorse or promote products
00019  *    derived from this software without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
00022  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00023  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
00024  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
00026  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00027  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00028  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
00029  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
00030  * OF SUCH DAMAGE.
00031  *
00032  * Author: Elias Oenal <lwip@eliasoenal.com>
00033  */
00034 
00035 #ifndef LWIP_HDR_APPS_SNMP_V3_PRIV_H
00036 #define LWIP_HDR_APPS_SNMP_V3_PRIV_H
00037 
00038 #include "lwip/apps/snmp_opts.h"
00039 
00040 #if LWIP_SNMP && LWIP_SNMP_V3
00041 
00042 #include "lwip/apps/snmpv3.h"
00043 #include "snmp_pbuf_stream.h"
00044 
00045 /* According to RFC 3411 */
00046 #define SNMP_V3_MAX_ENGINE_ID_LENGTH  32
00047 #define SNMP_V3_MAX_USER_LENGTH       32
00048 
00049 #define SNMP_V3_MAX_AUTH_PARAM_LENGTH  12
00050 #define SNMP_V3_MAX_PRIV_PARAM_LENGTH  8
00051 
00052 #define SNMP_V3_MD5_LEN        16
00053 #define SNMP_V3_SHA_LEN        20
00054 
00055 typedef enum {
00056   SNMP_V3_PRIV_MODE_DECRYPT = 0,
00057   SNMP_V3_PRIV_MODE_ENCRYPT = 1
00058 } snmpv3_priv_mode_t;
00059 
00060 s32_t snmpv3_get_engine_boots_internal(void);
00061 err_t snmpv3_auth(struct snmp_pbuf_stream *stream, u16_t length, const u8_t *key, snmpv3_auth_algo_t algo, u8_t *hmac_out);
00062 err_t snmpv3_crypt(struct snmp_pbuf_stream *stream, u16_t length, const u8_t *key,
00063                    const u8_t *priv_param, const u32_t engine_boots, const u32_t engine_time, snmpv3_priv_algo_t algo, snmpv3_priv_mode_t mode);
00064 err_t snmpv3_build_priv_param(u8_t *priv_param);
00065 void snmpv3_enginetime_timer(void *arg);
00066 
00067 #endif
00068 
00069 #endif /* LWIP_HDR_APPS_SNMP_V3_PRIV_H */