More work on modules.

FossilOrigin-Name: 0bbe4da84ffab94d8bcf71f8e153eeb1b6cd6b41d39dd3943a39d7fc291084f9
This commit is contained in:
7u83@mail.ru 2016-02-16 07:13:34 +00:00
parent 914138f2f3
commit 9785c8a25f
7 changed files with 95 additions and 102 deletions

View File

@ -65,7 +65,7 @@
# strict_headers
#
# If set to 1, any malformed packets wil b thrown away.
# If set to on, any malformed packets wil be thrown away.
#
# Default:
# strict_headers = on

View File

@ -215,7 +215,7 @@ int ac_run()
}
/* broadcast sockety ipv4 only */
/* broadcast socket ipv4 only */
for (i = 0; i < conf_bcast_addrs_len; i++) {
socklist_add_broadcast(conf_bcast_addrs[i], conf_control_port,
AC_PROTO_CAPWAP);

View File

@ -345,6 +345,7 @@ static int init_listen_addrs()
for (ifa=ifap; ifa!=0; ifa=ifa->ifa_next){
char str[100];
/** ignore loopback interfaces if configured*/
if(!conf_use_loopback){
if ((ifa->ifa_flags & IFF_LOOPBACK)){
continue;

View File

@ -5,6 +5,7 @@
static int init()
{
// regn = cw_register_actions_cipwap_ac(&capwap_actions);
return 1;
}

View File

@ -175,8 +175,7 @@ static int wtpman_establish_dtls(void *arg)
wtpman->conn->dtls_key_pass = conf_sslkeypass;
wtpman->conn->dtls_verify_peer = conf_dtls_verify_peer;
cw_dbg(DBG_DTLS, "Using key file %s", wtpman->conn->dtls_key_file);
cw_dbg(DBG_DTLS, "Using cert file %s",
wtpman->conn->dtls_cert_file);
cw_dbg(DBG_DTLS, "Using cert file %s", wtpman->conn->dtls_cert_file);
dtls_ok = 1;
}
@ -284,8 +283,7 @@ static void wtpman_image_data(struct wtpman *wtpman)
struct conn *conn = wtpman->conn;
/* Image upload */
const char *filename =
mbag_get_str(conn->outgoing, CW_ITEM_IMAGE_FILENAME,NULL);
const char *filename = mbag_get_str(conn->outgoing, CW_ITEM_IMAGE_FILENAME, NULL);
if (!filename) {
cw_log(LOG_ERR,
"Can't send image to %s. No Image Filename Item found.",
@ -317,9 +315,9 @@ static void wtpman_image_data(struct wtpman *wtpman)
if (rc) {
cw_log(LOG_ERR,"Error sending image to %s: %s",sock_addr2str(&conn->addr),cw_strrc(rc));
}
else {
cw_log(LOG_ERR, "Error sending image to %s: %s",
sock_addr2str(&conn->addr), cw_strrc(rc));
} else {
cw_dbg(DBG_INFO, "Image '%s' sucessful sent to %s in %0.1f seconds.",
filename, sock_addr2str(&conn->addr), cw_clock_stop(&clk));
conn->capwap_state = CW_STATE_NONE;
@ -341,7 +339,8 @@ void config_to_sql(struct conn *conn)
mavliter_foreach(&it) {
mbag_item_t *i = mavliter_get(&it);
const struct cw_itemdef * cwi = cw_itemdef_get(conn->actions->items,i->id,NULL);
const struct cw_itemdef *cwi =
cw_itemdef_get(conn->actions->items, i->id, NULL);
if (cwi) {
DBGX("ID %s,%s", i->id, cwi->id);
DBGX("Typei %s,Typecwd %s", i->type->name, cwi->type->name);
@ -351,15 +350,13 @@ void config_to_sql(struct conn *conn)
if (i->type->to_str) {
i->type->to_str(i, str);
db_put_wtp_prop(wtp_id, cwi->id, cwi->sub_id, str);
}
else{
} else {
cw_log(LOG_ERR, "Can't converto to str");
}
}
else{
} else {
// DBGX("ID %d",i->id);
}
@ -500,16 +497,17 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr)
int replyfd;
if (srcaddr->sa_family == AF_INET && socklist[socklistindex].type!=SOCKLIST_UNICAST_SOCKET) {
if (srcaddr->sa_family == AF_INET
&& socklist[socklistindex].type != SOCKLIST_UNICAST_SOCKET) {
extern int socklist_find_reply_socket(struct sockaddr *sa);
replyfd = socklist_find_reply_socket(srcaddr);
if (replyfd == -1) {
cw_log(LOG_ERR,"Can't find reply socket for request from %s",sock_addr2str(srcaddr));
cw_log(LOG_ERR, "Can't find reply socket for request from %s",
sock_addr2str(srcaddr));
free(wtpman);
return NULL;
}
}
else{
} else {
replyfd = socklist[socklistindex].sockfd;
}

View File

@ -30,13 +30,6 @@
#include "conn.h"
#include "sock.h"
#include <stdio.h> //tube
int conn_send_msg(struct conn *conn, uint8_t * rawmsg);
@ -114,7 +107,7 @@ int cw_send_response(struct conn *conn, uint8_t * rawmsg, int len)
/**
* Special case error message, which is sent when an unexpected messages
* was received or somethin else happened.
* was received or something else happened.
* @param conn conection
* @param rawmsg the received request message, which the response belongs to
* @pqram result_code result code to send

View File

@ -1,2 +1,2 @@
#!/bin/sh
indent -l90 -kr -ts8 -i8 -cli8 -cbi0 $1
gindent -l90 -kr -ts8 -i8 -cli8 -cbi0 $1