comparison dbutil.h @ 297:79bf1023cf11 agent-client

propagate from branch 'au.asn.ucc.matt.dropbear' (head 0501e6f661b5415eb76f3b312d183c3adfbfb712) to branch 'au.asn.ucc.matt.dropbear.cli-agent' (head 01038174ec27245b51bd43a66c01ad930880f67b)
author Matt Johnston <matt@ucc.asn.au>
date Tue, 21 Mar 2006 16:20:59 +0000
parents ca7e76d981d9 044bc108b9b3
children c1e9c81d1d27
comparison
equal deleted inserted replaced
225:ca7e76d981d9 297:79bf1023cf11
37 extern void (*_dropbear_log)(int priority, const char* format, va_list param); 37 extern void (*_dropbear_log)(int priority, const char* format, va_list param);
38 38
39 void dropbear_exit(const char* format, ...); 39 void dropbear_exit(const char* format, ...);
40 void dropbear_close(const char* format, ...); 40 void dropbear_close(const char* format, ...);
41 void dropbear_log(int priority, const char* format, ...); 41 void dropbear_log(int priority, const char* format, ...);
42 void fail_assert(const char* expr, const char* file, int line);
42 #ifdef DEBUG_TRACE 43 #ifdef DEBUG_TRACE
43 void dropbear_trace(const char* format, ...); 44 void dropbear_trace(const char* format, ...);
44 void printhex(const char * label, const unsigned char * buf, int len); 45 void printhex(const char * label, const unsigned char * buf, int len);
45 extern int debug_trace; 46 extern int debug_trace;
46 #endif 47 #endif
55 int nonblocking, char ** errstring); 56 int nonblocking, char ** errstring);
56 char* getaddrhostname(struct sockaddr_storage * addr); 57 char* getaddrhostname(struct sockaddr_storage * addr);
57 int buf_readfile(buffer* buf, const char* filename); 58 int buf_readfile(buffer* buf, const char* filename);
58 int buf_getline(buffer * line, FILE * authfile); 59 int buf_getline(buffer * line, FILE * authfile);
59 60
60 int m_close(int fd); 61 void m_close(int fd);
61 void * m_malloc(size_t size); 62 void * m_malloc(size_t size);
62 void * m_strdup(const char * str); 63 void * m_strdup(const char * str);
63 void * m_realloc(void* ptr, size_t size); 64 void * m_realloc(void* ptr, size_t size);
64 #define m_free(X) __m_free(X); (X) = NULL; 65 #define m_free(X) __m_free(X); (X) = NULL;
65 void __m_free(void* ptr); 66 void __m_free(void* ptr);
67 void setnonblocking(int fd); 68 void setnonblocking(int fd);
68 69
69 /* Used to force mp_ints to be initialised */ 70 /* Used to force mp_ints to be initialised */
70 #define DEF_MP_INT(X) mp_int X = {0, 0, 0, NULL} 71 #define DEF_MP_INT(X) mp_int X = {0, 0, 0, NULL}
71 72
73 /* Dropbear assertion */
74 #define dropbear_assert(X) do { if (!(X)) { fail_assert(#X, __FILE__, __LINE__); } } while (0)
75
72 #endif /* _DBUTIL_H_ */ 76 #endif /* _DBUTIL_H_ */