summaryrefslogtreecommitdiffstats
path: root/src/customdhcpcd/logwriter.h
blob: 43f35faf1f5f0ec242101e493a0b1f3c734c9829 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * logwriter.h
 *
 *  Created on: Jul 7, 2011
 *      Author: niklas
 */

#ifndef LOGWRITER_H_
#define LOGWRITER_H_

#include <arpa/inet.h>
#include "dhcp.h"
#include "interface.h"
#include "dhcpcd.h"

#define LOG_MSG_SIZE 1024

typedef struct _log_msg log_msg;
struct _log_msg {
	int status;
	int substatus;
	char device[IF_NAMESIZE];
	char msg[LOG_MSG_SIZE];
};

/**
 * new functions for communicating with Qt
 */
void setSocketName(const char * sn);
void setInterfaceName(const char * in);
int initQtLoggerSocket ();
void closeQtLoggerSocket ();
void sendToQt ();
void logToQt(int status, int substatus, const char * msg);
void logSendToQt(int type);
void logLoggerToQt(int level, const char *fmt, ...);
//void logToQt(char * status, char * substatus, char * msg);
void logGatewayToFile(const interface_t *iface, const dhcp_t *dhcp);

#endif /* LOGWRITER_H_ */