Remove trailing whitespace
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
62994531e2
commit
a2286c0889
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||||
|
|
||||||
#ifndef __linux__
|
#ifndef __linux__
|
||||||
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__Darwin__) || defined(__GLIBC__)
|
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__Darwin__) || defined(__GLIBC__)
|
||||||
#include <net/if_dl.h>
|
#include <net/if_dl.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -107,13 +107,13 @@ struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct i
|
||||||
{
|
{
|
||||||
int netsocket = -1;
|
int netsocket = -1;
|
||||||
int *ioref;
|
int *ioref;
|
||||||
|
|
||||||
struct ast_netsock *ns;
|
struct ast_netsock *ns;
|
||||||
const int reuseFlag = 1;
|
const int reuseFlag = 1;
|
||||||
|
|
||||||
/* Make a UDP socket */
|
/* Make a UDP socket */
|
||||||
netsocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
|
netsocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
|
||||||
|
|
||||||
if (netsocket < 0) {
|
if (netsocket < 0) {
|
||||||
ast_log(LOG_ERROR, "Unable to create network socket: %s\n", strerror(errno));
|
ast_log(LOG_ERROR, "Unable to create network socket: %s\n", strerror(errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -128,20 +128,20 @@ struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct i
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_netsock_set_qos(netsocket, tos, cos, "IAX2");
|
ast_netsock_set_qos(netsocket, tos, cos, "IAX2");
|
||||||
|
|
||||||
ast_enable_packet_fragmentation(netsocket);
|
ast_enable_packet_fragmentation(netsocket);
|
||||||
|
|
||||||
if (!(ns = ast_calloc(1, sizeof(*ns)))) {
|
if (!(ns = ast_calloc(1, sizeof(*ns)))) {
|
||||||
close(netsocket);
|
close(netsocket);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Establish I/O callback for socket read */
|
/* Establish I/O callback for socket read */
|
||||||
if (!(ioref = ast_io_add(ioc, netsocket, callback, AST_IO_IN, ns))) {
|
if (!(ioref = ast_io_add(ioc, netsocket, callback, AST_IO_IN, ns))) {
|
||||||
close(netsocket);
|
close(netsocket);
|
||||||
ast_free(ns);
|
ast_free(ns);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ASTOBJ_INIT(ns);
|
ASTOBJ_INIT(ns);
|
||||||
ns->ioref = ioref;
|
ns->ioref = ioref;
|
||||||
ns->ioc = ioc;
|
ns->ioc = ioc;
|
||||||
|
@ -156,22 +156,22 @@ struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct i
|
||||||
int ast_netsock_set_qos(int netsocket, int tos, int cos, const char *desc)
|
int ast_netsock_set_qos(int netsocket, int tos, int cos, const char *desc)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
if ((res = setsockopt(netsocket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos))))
|
if ((res = setsockopt(netsocket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos))))
|
||||||
ast_log(LOG_WARNING, "Unable to set %s TOS to %d, may be you have no root privileges\n", desc, tos);
|
ast_log(LOG_WARNING, "Unable to set %s TOS to %d, may be you have no root privileges\n", desc, tos);
|
||||||
else if (tos)
|
else if (tos)
|
||||||
ast_verb(2, "Using %s TOS bits %d\n", desc, tos);
|
ast_verb(2, "Using %s TOS bits %d\n", desc, tos);
|
||||||
|
|
||||||
#if defined(linux)
|
#if defined(linux)
|
||||||
if (setsockopt(netsocket, SOL_SOCKET, SO_PRIORITY, &cos, sizeof(cos)))
|
if (setsockopt(netsocket, SOL_SOCKET, SO_PRIORITY, &cos, sizeof(cos)))
|
||||||
ast_log(LOG_WARNING, "Unable to set %s CoS to %d\n", desc, cos);
|
ast_log(LOG_WARNING, "Unable to set %s CoS to %d\n", desc, cos);
|
||||||
else if (cos)
|
else if (cos)
|
||||||
ast_verb(2, "Using %s CoS mark %d\n", desc, cos);
|
ast_verb(2, "Using %s CoS mark %d\n", desc, cos);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct ast_netsock *ast_netsock_bind(struct ast_netsock_list *list, struct io_context *ioc, const char *bindinfo, int defaultport, int tos, int cos, ast_io_cb callback, void *data)
|
struct ast_netsock *ast_netsock_bind(struct ast_netsock_list *list, struct io_context *ioc, const char *bindinfo, int defaultport, int tos, int cos, ast_io_cb callback, void *data)
|
||||||
{
|
{
|
||||||
|
@ -281,7 +281,7 @@ void ast_set_default_eid(struct ast_eid *eid)
|
||||||
#if defined(ifa_broadaddr) && !defined(SOLARIS)
|
#if defined(ifa_broadaddr) && !defined(SOLARIS)
|
||||||
char eid_str[20];
|
char eid_str[20];
|
||||||
struct ifaddrs *ifap;
|
struct ifaddrs *ifap;
|
||||||
|
|
||||||
if (getifaddrs(&ifap) == 0) {
|
if (getifaddrs(&ifap) == 0) {
|
||||||
struct ifaddrs *p;
|
struct ifaddrs *p;
|
||||||
for (p = ifap; p; p = p->ifa_next) {
|
for (p = ifap; p; p = p->ifa_next) {
|
||||||
|
@ -308,7 +308,7 @@ int ast_str_to_eid(struct ast_eid *eid, const char *s)
|
||||||
if (sscanf(s, "%2x:%2x:%2x:%2x:%2x:%2x", &eid_int[0], &eid_int[1], &eid_int[2],
|
if (sscanf(s, "%2x:%2x:%2x:%2x:%2x:%2x", &eid_int[0], &eid_int[1], &eid_int[2],
|
||||||
&eid_int[3], &eid_int[4], &eid_int[5]) != 6)
|
&eid_int[3], &eid_int[4], &eid_int[5]) != 6)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
for (x = 0; x < 6; x++)
|
for (x = 0; x < 6; x++)
|
||||||
eid->eid[x] = eid_int[x];
|
eid->eid[x] = eid_int[x];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue