00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef __transforms_h
00038 #define __transforms_h
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00044 #include"common.h"
00045
00046
00050 struct Transform
00051 {
00052 struct Transform *next;
00053
00054 uint8_t type;
00055 uint16_t id;
00056 uint16_t keyLen;
00057 };
00058
00063 struct Protocol
00064 {
00065 struct Protocol *next;
00066
00067 uint8_t protocol;
00068 struct Transform *transforms;
00069 uint8_t SPISize;
00070 uint64_t SPI;
00071 };
00072
00076 struct Proposal
00077 {
00078 struct Proposal *next;
00079 struct Protocol *protocols;
00080 };
00081
00082
00083
00084 struct Proposal *AddProposal( struct Proposal **list );
00085 void RemoveProposal( struct Proposal *prop, struct Proposal **list );
00086 void DeleteProposal( struct Proposal *prop );
00087 void DeleteProposalList( struct Proposal *prop );
00088 struct Protocol *AddProtocol( struct Proposal *prop, uint8_t protocol, uint8_t SPISize,
00089 uint32_t SPI );
00090 void RemoveProtocol( struct Protocol *protocol, struct Proposal *prop );
00091 void DeleteProtocol( struct Protocol *protocol );
00092 int AddTransform( struct Protocol *protocol, uint8_t type, uint16_t id, uint16_t keyLen );
00093 void RemoveTransform( struct Transform *trans, struct Protocol *protocol );
00094 uint16_t GetTransformID( uint8_t type, uint8_t protocol, struct Protocol *list );
00095 uint16_t GetTransformKeyLen( uint8_t type, uint8_t protocol, struct Protocol *list );
00096 int CheckNeededTransforms( struct Proposal *prop );
00097 struct Proposal *FindFirstSupportedProposal( struct Proposal *prop, struct Proposal *list );
00098 int CmpProposal( struct Proposal *p1, struct Proposal *p2 );
00099 struct Proposal *FindProposal( struct Proposal *prop, struct Proposal *list );
00100
00101 #ifdef __cplusplus
00102 }
00103 #endif
00104
00105 #endif