mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
use const
This commit is contained in:
@@ -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];
|
||||
|
||||
10
src/main.c
10
src/main.c
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user