Ram Gandikota / Mbed OS ABCD
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers m2mconnectionsecurity_stub.cpp Source File

m2mconnectionsecurity_stub.cpp

00001 /*
00002  * Copyright (c) 2015 ARM Limited. All rights reserved.
00003  * SPDX-License-Identifier: Apache-2.0
00004  * Licensed under the Apache License, Version 2.0 (the License); you may
00005  * not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
00012  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #include "m2mconnectionhandler.h"
00018 #include "m2mconnectionsecurity.h"
00019 #include "m2mtimer.h"
00020 #include "m2msecurity.h"
00021 #include <string.h>
00022 #include "m2mconnectionsecurity_stub.h"
00023 
00024 bool m2mconnectionsecurityimpl_stub::use_inc_int;
00025 int m2mconnectionsecurityimpl_stub::inc_int_value;
00026 int m2mconnectionsecurityimpl_stub::int_value;
00027 
00028 void m2mconnectionsecurityimpl_stub::clear()
00029 {
00030     int_value = -1;
00031     use_inc_int = false;
00032     inc_int_value = 0;
00033 }
00034 
00035 M2MConnectionSecurity::M2MConnectionSecurity(M2MConnectionSecurity::SecurityMode mode)
00036 {
00037 
00038 }
00039 
00040 M2MConnectionSecurity::~M2MConnectionSecurity(){
00041 }
00042 
00043 void M2MConnectionSecurity::reset(){
00044 }
00045 
00046 int M2MConnectionSecurity::init(const M2MSecurity *security){
00047     if(m2mconnectionsecurityimpl_stub::use_inc_int){
00048         return m2mconnectionsecurityimpl_stub::inc_int_value++;
00049     }
00050     return m2mconnectionsecurityimpl_stub::int_value;
00051 }
00052 
00053 int M2MConnectionSecurity::connect(M2MConnectionHandler* connHandler){
00054     if(m2mconnectionsecurityimpl_stub::use_inc_int){
00055         return m2mconnectionsecurityimpl_stub::inc_int_value++;
00056     }
00057     return m2mconnectionsecurityimpl_stub::int_value;
00058 }
00059 
00060 int M2MConnectionSecurity::start_connecting_non_blocking(M2MConnectionHandler* connHandler)
00061 {
00062     if(m2mconnectionsecurityimpl_stub::use_inc_int){
00063         return m2mconnectionsecurityimpl_stub::inc_int_value++;
00064     }
00065     return m2mconnectionsecurityimpl_stub::int_value;
00066 }
00067 
00068 int M2MConnectionSecurity::continue_connecting()
00069 {
00070     if(m2mconnectionsecurityimpl_stub::use_inc_int){
00071         return m2mconnectionsecurityimpl_stub::inc_int_value++;
00072     }
00073     return m2mconnectionsecurityimpl_stub::int_value;
00074 }
00075 
00076 int M2MConnectionSecurity::send_message(unsigned char *message, int len){
00077     if(m2mconnectionsecurityimpl_stub::use_inc_int){
00078         return m2mconnectionsecurityimpl_stub::inc_int_value++;
00079     }
00080     return m2mconnectionsecurityimpl_stub::int_value;
00081 }
00082 
00083 int M2MConnectionSecurity::read(unsigned char* buffer, uint16_t len){
00084     if(m2mconnectionsecurityimpl_stub::use_inc_int){
00085         return m2mconnectionsecurityimpl_stub::inc_int_value++;
00086     }
00087     return m2mconnectionsecurityimpl_stub::int_value;
00088 }
00089 
00090 void M2MConnectionSecurity::set_random_number_callback(random_number_cb)
00091 {
00092 
00093 }
00094 
00095 void M2MConnectionSecurity::set_entropy_callback(mbedtls_entropy)
00096 {
00097 
00098 }