mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Asterisk -- An open source telephony toolkit.
|
||||
*
|
||||
* Implementation of Inter-Asterisk eXchange
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2003, Digium
|
||||
*
|
||||
* Mark Spencer <markster@linux-support.net>
|
||||
@@ -19,7 +19,7 @@
|
||||
* \ref iax2-parser.h
|
||||
* \ref chan_iax2.c
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _IAX2_H
|
||||
#define _IAX2_H
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* Asterisk -- An open source telephony toolkit.
|
||||
*
|
||||
* Implementation of Inter-Asterisk eXchange
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2003, Digium
|
||||
*
|
||||
* Mark Spencer <markster@digium.com>
|
||||
@@ -14,7 +14,7 @@
|
||||
/*!\file
|
||||
* \brief Implementation of the IAX2 protocol
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _IAX2_PARSER_H
|
||||
#define _IAX2_PARSER_H
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
*
|
||||
* \brief Implementation of Inter-Asterisk eXchange Protocol, v 2
|
||||
*
|
||||
* \author Mark Spencer <markster@digium.com>
|
||||
* \author Mark Spencer <markster@digium.com>
|
||||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
@@ -136,7 +136,7 @@ static void dump_prefs(char *output, int maxlen, void *value, int len)
|
||||
|
||||
strncpy(output, value, maxlen);
|
||||
output[maxlen] = '\0';
|
||||
|
||||
|
||||
iax2_codec_pref_convert(&pref, output, total_len, 0);
|
||||
memset(output,0,total_len);
|
||||
iax2_codec_pref_string(&pref, output, total_len);
|
||||
@@ -147,7 +147,7 @@ static void dump_int(char *output, int maxlen, void *value, int len)
|
||||
if (len == (int)sizeof(unsigned int))
|
||||
snprintf(output, maxlen, "%lu", (unsigned long)ntohl(get_unaligned_uint32(value)));
|
||||
else
|
||||
ast_copy_string(output, "Invalid INT", maxlen);
|
||||
ast_copy_string(output, "Invalid INT", maxlen);
|
||||
}
|
||||
|
||||
static void dump_short(char *output, int maxlen, void *value, int len)
|
||||
@@ -177,7 +177,7 @@ static void dump_datetime(char *output, int maxlen, void *value, int len)
|
||||
tm.tm_mday = (val >> 16) & 0x1f;
|
||||
tm.tm_mon = ((val >> 21) & 0x0f) - 1;
|
||||
tm.tm_year = ((val >> 25) & 0x7f) + 100;
|
||||
ast_strftime(output, maxlen, "%Y-%m-%d %T", &tm);
|
||||
ast_strftime(output, maxlen, "%Y-%m-%d %T", &tm);
|
||||
} else
|
||||
ast_copy_string(output, "Invalid DATETIME format!", maxlen);
|
||||
}
|
||||
@@ -366,7 +366,7 @@ static void dump_prov_ies(char *output, int maxlen, unsigned char *iedata, int l
|
||||
char tmp[256];
|
||||
if (len < 2)
|
||||
return;
|
||||
strcpy(output, "\n");
|
||||
strcpy(output, "\n");
|
||||
maxlen -= strlen(output); output += strlen(output);
|
||||
while(len > 2) {
|
||||
ie = iedata[0];
|
||||
@@ -748,14 +748,14 @@ int iax_ie_append_versioned_uint64(struct iax_ie_data *ied, unsigned char ie, un
|
||||
return iax_ie_append_raw(ied, ie, &newval, (int) sizeof(newval));
|
||||
}
|
||||
|
||||
int iax_ie_append_int(struct iax_ie_data *ied, unsigned char ie, unsigned int value)
|
||||
int iax_ie_append_int(struct iax_ie_data *ied, unsigned char ie, unsigned int value)
|
||||
{
|
||||
unsigned int newval;
|
||||
newval = htonl(value);
|
||||
return iax_ie_append_raw(ied, ie, &newval, (int)sizeof(newval));
|
||||
}
|
||||
|
||||
int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned short value)
|
||||
int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned short value)
|
||||
{
|
||||
unsigned short newval;
|
||||
newval = htons(value);
|
||||
@@ -772,7 +772,7 @@ int iax_ie_append_byte(struct iax_ie_data *ied, unsigned char ie, unsigned char
|
||||
return iax_ie_append_raw(ied, ie, &dat, 1);
|
||||
}
|
||||
|
||||
int iax_ie_append(struct iax_ie_data *ied, unsigned char ie)
|
||||
int iax_ie_append(struct iax_ie_data *ied, unsigned char ie)
|
||||
{
|
||||
return iax_ie_append_raw(ied, ie, NULL, 0);
|
||||
}
|
||||
@@ -978,7 +978,7 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen)
|
||||
snprintf(tmp, (int)sizeof(tmp), "Expecting msgcount to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
|
||||
errorf(tmp);
|
||||
} else
|
||||
ies->msgcount = ntohs(get_unaligned_uint16(data + 2));
|
||||
ies->msgcount = ntohs(get_unaligned_uint16(data + 2));
|
||||
break;
|
||||
case IAX_IE_AUTOANSWER:
|
||||
ies->autoanswer = 1;
|
||||
@@ -1005,7 +1005,7 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen)
|
||||
snprintf(tmp, (int)sizeof(tmp), "Expecting firmwarever to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
|
||||
errorf(tmp);
|
||||
} else
|
||||
ies->firmwarever = ntohs(get_unaligned_uint16(data + 2));
|
||||
ies->firmwarever = ntohs(get_unaligned_uint16(data + 2));
|
||||
break;
|
||||
case IAX_IE_DEVICETYPE:
|
||||
ies->devicetype = (char *)data + 2;
|
||||
@@ -1058,7 +1058,7 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen)
|
||||
snprintf(tmp, (int)sizeof(tmp), "Expecting callingtns to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
|
||||
errorf(tmp);
|
||||
} else
|
||||
ies->calling_tns = ntohs(get_unaligned_uint16(data + 2));
|
||||
ies->calling_tns = ntohs(get_unaligned_uint16(data + 2));
|
||||
break;
|
||||
case IAX_IE_RR_JITTER:
|
||||
if (len != (int)sizeof(unsigned int)) {
|
||||
@@ -1267,12 +1267,12 @@ struct iax_frame *iax_frame_new(int direction, int datalen, unsigned int cacheab
|
||||
|
||||
fr->direction = direction;
|
||||
fr->retrans = -1;
|
||||
|
||||
|
||||
if (fr->direction == DIRECTION_INGRESS)
|
||||
ast_atomic_fetchadd_int(&iframes, 1);
|
||||
else
|
||||
ast_atomic_fetchadd_int(&oframes, 1);
|
||||
|
||||
|
||||
ast_atomic_fetchadd_int(&frames, 1);
|
||||
|
||||
return fr;
|
||||
|
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
|
||||
/*! \file
|
||||
*
|
||||
* \brief IAX Provisioning Protocol
|
||||
*
|
||||
* \brief IAX Provisioning Protocol
|
||||
*
|
||||
* \author Mark Spencer <markster@digium.com>
|
||||
*/
|
||||
@@ -93,7 +93,7 @@ char *iax_provflags2str(char *buf, int buflen, unsigned int flags)
|
||||
|
||||
if (!buf || buflen < 1)
|
||||
return NULL;
|
||||
|
||||
|
||||
buf[0] = '\0';
|
||||
|
||||
for (x = 0; x < ARRAY_LEN(iax_flags); x++) {
|
||||
@@ -103,7 +103,7 @@ char *iax_provflags2str(char *buf, int buflen, unsigned int flags)
|
||||
}
|
||||
}
|
||||
|
||||
if (!ast_strlen_zero(buf))
|
||||
if (!ast_strlen_zero(buf))
|
||||
buf[strlen(buf) - 1] = '\0';
|
||||
else
|
||||
strncpy(buf, "none", buflen - 1);
|
||||
@@ -239,7 +239,7 @@ int iax_provision_build(struct iax_ie_data *provdata, unsigned int *signature, c
|
||||
iax_ie_append_int(provdata, PROV_IE_FORMAT, cur->format);
|
||||
if (force || cur->tos)
|
||||
iax_ie_append_byte(provdata, PROV_IE_TOS, cur->tos);
|
||||
|
||||
|
||||
/* Calculate checksum of message so far */
|
||||
sig = prov_ver_calc(provdata);
|
||||
if (signature)
|
||||
@@ -299,7 +299,7 @@ static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg,
|
||||
ast_log(LOG_WARNING, "Unable to find base template '%s' for creating '%s'. Trying '%s'\n", t, s, def);
|
||||
else
|
||||
def = t;
|
||||
}
|
||||
}
|
||||
if (!src) {
|
||||
src = iax_template_find(def, 0);
|
||||
if (!src)
|
||||
@@ -342,7 +342,7 @@ static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg,
|
||||
cur->server = ntohl(ia.s_addr);
|
||||
else
|
||||
cur->altserver = ntohl(ia.s_addr);
|
||||
} else
|
||||
} else
|
||||
ast_log(LOG_WARNING, "Ignoring invalid %s '%s' for '%s' at line %d\n", v->name, v->value, s, v->lineno);
|
||||
} else if (!strcasecmp(v->name, "codec")) {
|
||||
struct ast_format *tmpfmt;
|
||||
@@ -425,10 +425,10 @@ static const char *ifthere(const char *s)
|
||||
static const char *iax_server(unsigned int addr)
|
||||
{
|
||||
struct in_addr ia;
|
||||
|
||||
|
||||
if (!addr)
|
||||
return "<unspecified>";
|
||||
|
||||
|
||||
ia.s_addr = htonl(addr);
|
||||
|
||||
return ast_inet_ntoa(ia);
|
||||
@@ -461,7 +461,7 @@ static char *iax_show_provisioning(struct ast_cli_entry *e, int cmd, struct ast_
|
||||
ast_mutex_lock(&provlock);
|
||||
AST_LIST_TRAVERSE(&templates, cur, list) {
|
||||
if ((a->argc == 3) || (!strcasecmp(a->argv[3], cur->name))) {
|
||||
if (found)
|
||||
if (found)
|
||||
ast_cli(a->fd, "\n");
|
||||
ast_copy_string(server, iax_server(cur->server), sizeof(server));
|
||||
ast_copy_string(alternate, iax_server(cur->altserver), sizeof(alternate));
|
||||
@@ -535,7 +535,7 @@ int iax_provision_reload(int reload)
|
||||
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||
if (!provinit)
|
||||
iax_provision_init();
|
||||
|
||||
|
||||
cfg = ast_config_load2("iaxprov.conf", "chan_iax2", config_flags);
|
||||
if (cfg != NULL && cfg != CONFIG_STATUS_FILEUNCHANGED && cfg != CONFIG_STATUS_FILEINVALID) {
|
||||
/* Mark all as dead. No need for locking */
|
||||
|
Reference in New Issue
Block a user