use const

This commit is contained in:
Nikos Mavrogiannopoulos
2013-01-28 23:38:06 +01:00
parent ba3705529e
commit bd11f34cc6
5 changed files with 10 additions and 8 deletions

View File

@@ -64,7 +64,7 @@ const char *human_addr(const struct sockaddr *sa, socklen_t salen,
}
int __attribute__ ((format(printf, 3, 4)))
oclog(server_st * server, int priority, const char *fmt, ...)
oclog(const server_st * server, int priority, const char *fmt, ...)
{
char buf[1024];
char ipbuf[128];

View File

@@ -56,7 +56,8 @@ struct proc_list_st {
socklen_t remote_addr_len;
};
static int handle_commands(struct cfg_st *config, struct tun_st *tun, struct proc_list_st*);
static int handle_commands(const struct cfg_st *config, const struct tun_st *tun,
const struct proc_list_st* proc);
static void tls_log_func(int level, const char *str)
{
@@ -574,8 +575,8 @@ static int send_auth_reply(int fd, cmd_auth_reply_t r, struct tun_id_st* tunid)
return(sendmsg(fd, &hdr, 0));
}
static int handle_auth_req(struct cfg_st *config, struct tun_st *tun,
struct cmd_auth_req_st * req, struct tun_id_st *tunid)
static int handle_auth_req(const struct cfg_st *config, const struct tun_st *tun,
const struct cmd_auth_req_st * req, struct tun_id_st *tunid)
{
int ret;
#warning fix auth
@@ -593,7 +594,8 @@ int ret;
return ret;
}
static int handle_commands(struct cfg_st *config, struct tun_st *tun, struct proc_list_st* proc)
static int handle_commands(const struct cfg_st *config, const struct tun_st *tun,
const struct proc_list_st* proc)
{
struct iovec iov[2];
char buf[128];

View File

@@ -98,7 +98,7 @@ static int set_network_info(const char* vname, const struct vpn_st *vinfo)
return ret;
}
int open_tun(struct cfg_st *config, struct tun_st* tun, struct tun_id_st *id)
int open_tun(const struct cfg_st *config, const struct tun_st* tun, struct tun_id_st *id)
{
int tunfd, ret, e;
struct ifreq ifr;

View File

@@ -4,6 +4,6 @@
#include <vpn.h>
int open_tun(struct cfg_st *config, struct tun_st* tun, struct tun_id_st *id);
int open_tun(const struct cfg_st *config, const struct tun_st* tun, struct tun_id_st *id);
#endif

View File

@@ -139,7 +139,7 @@ const char *human_addr(const struct sockaddr *sa, socklen_t salen,
void *buf, size_t buflen);
int __attribute__ ((format(printf, 3, 4)))
oclog(server_st * server, int priority, const char *fmt, ...);
oclog(const server_st * server, int priority, const char *fmt, ...);
#endif