Commit Graph

22 Commits

Author SHA1 Message Date
DL6ER 602bd07a50 Only include smaller header files in the source code files. Remove routines.h
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-06-29 21:39:58 +02:00
DL6ER 7a100aed53 Modularize header files
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-06-29 18:01:37 +02:00
DL6ER 6fcbce6c34 Improve code based on a full static analysis of our code. There are no real bugs, nowever, we use the obtained knowledge to improve the code such as unify declarations and function definitions, reduce the scope of local variables, mark many function arguments and local variables const when they are, fix the type expected by %x and fix one if-condition
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-04-15 22:35:14 +02:00
DL6ER d653f4dd85 Declare input data for swrite() as const void*
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-03-10 19:44:31 +01:00
DL6ER 0d6f424f1f Enforce prototyping. This ensures that function that are not explicitly made globally available across files (through an explicit prototype in a header file) need to be marked static such that their scope is limited to where they are actually used. This also enforces strict prototyping, i.e., a function with zero arguments needs to be written explicitly as function(void) as a non-strict prototype such as function() would in fact allow an arbitrary amount of parameters.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-03-10 15:31:14 +01:00
DL6ER a3924c06cf Declare return value of getstr() as const char* because the returned strings should not be modifiable. Similarly, neither pack_fixstr() nor pack_str32() should be able to modify strings they are given. Furthermore, getDomainString(), getClientIPString(), getClientNameString(), getSetupVarsArray(), insetupVarsArray(), and getSetupVarsBool() should never modify the strings they receive as arguments.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-03-10 11:24:51 +01:00
DL6ER 32be41ed5d Declare attributes for functions in FTL. These attributes help the compiler to optimize functions calls and to check our code more carefully during compilation. See pull reqeust text for details.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-03-08 11:36:11 +01:00
DL6ER 333163529f Fix signedness of integer constant. This was a problem on 32bit platforms.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-03 12:20:38 +01:00
Mcat12 5341b18ecf Handle possible pack_fixstr or pack_str32 error
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-21 15:40:58 -05:00
Mcat12 b6b7b5708b Only allow up to 2GB strings to be sent
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-21 12:46:46 -05:00
Mcat12 9f5ae62423 Fix indentation in msgpack.c
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-20 21:40:41 -05:00
Mcat12 da7c354b71 Add socket implementation to getUnknownQueries and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 23:29:16 -05:00
Mcat12 64a1408e5d Add socket implementation of getDBstats and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 22:51:04 -05:00
Mcat12 89ea9960aa Fix pack_uint64
It needed to have its endianness flipped.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 21:49:18 -05:00
Mcat12 81200a270d Add socket implementation to getMemoryUsage and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 21:10:14 -05:00
Mcat12 7d3dfb6351 Don't send fixarray for getAllQueries
It's unnecessary

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-06 12:33:13 -05:00
Mcat12 348a2ee81e Add socket implementation for getAllQueries
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-06 00:46:20 -05:00
Mcat12 4386138ddd Use uint8_t instead of unsigned char in msgpack.c
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-05 22:51:00 -05:00
Mcat12 4eaf794b63 Tighten parameters on pack_unsigned_char
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-05 22:48:43 -05:00
Mcat12 e54b3913f9 Add socket implementation for getOverTime
Adds the map16 structure to msgpack.c and tightens the pack_int
signature to only accept int32_t types.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-05 22:14:36 -05:00
Mcat12 616b10a599 Add swrite function
It will print a warning if an error happens, like the other s* functions
in socket.c

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-04 12:28:40 -05:00
Mcat12 e527985371 Implement getStats using MessagePack
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-04 12:04:04 -05:00