Browse Source

get rid of sendmsg use of ancillary data

pull/163/head
Richard Fuchs 11 years ago
parent
commit
52cfcdfb04
9 changed files with 63 additions and 194 deletions
  1. +0
    -38
      daemon/aux.h
  2. +0
    -8
      daemon/call.c
  3. +0
    -1
      daemon/call.h
  4. +2
    -16
      daemon/dtls.c
  5. +13
    -14
      daemon/ice.c
  6. +2
    -2
      daemon/ice.h
  7. +5
    -63
      daemon/media_socket.c
  8. +39
    -50
      daemon/stun.c
  9. +2
    -2
      daemon/stun.h

+ 0
- 38
daemon/aux.h View File

@ -225,44 +225,6 @@ INLINE int rlim(int res, rlim_t val) {
#define DF IPF ":%u"
#define DP(x) IPP((x).sin_addr.s_addr), ntohs((x).sin_port)
/* XXX to be removed */
#include "socket.h"
INLINE void msg_mh_src(const sockaddr_t *src, struct msghdr *mh) {
struct cmsghdr *ch;
struct in_pktinfo *pi;
struct in6_pktinfo *pi6;
//struct sockaddr_in6 *sin6;
//sin6 = mh->msg_name;
ch = CMSG_FIRSTHDR(mh);
ZERO(*ch);
if (src->family->af == AF_INET) {
ch->cmsg_len = CMSG_LEN(sizeof(*pi));
ch->cmsg_level = IPPROTO_IP;
ch->cmsg_type = IP_PKTINFO;
pi = (void *) CMSG_DATA(ch);
ZERO(*pi);
pi->ipi_spec_dst = src->u.ipv4;
mh->msg_controllen = CMSG_SPACE(sizeof(*pi));
}
else {
ch->cmsg_len = CMSG_LEN(sizeof(*pi6));
ch->cmsg_level = IPPROTO_IPV6;
ch->cmsg_type = IPV6_PKTINFO;
pi6 = (void *) CMSG_DATA(ch);
ZERO(*pi6);
pi6->ipi6_addr = src->u.ipv6;
mh->msg_controllen = CMSG_SPACE(sizeof(*pi6));
}
}
/*** MUTEX ABSTRACTION ***/


+ 0
- 8
daemon/call.c View File

@ -134,14 +134,6 @@ static int monologue_destroy(struct call_monologue *ml);
void stream_msg_mh_src(struct packet_stream *ps, struct msghdr *mh) {
const struct local_intf *ifa;
ifa = ps->selected_sfd->local_intf;
msg_mh_src(&ifa->spec->address.addr, mh);
}
/* called with call->master_lock held in R */
static int call_timer_delete_monologues(struct call *c) {
GSList *i;


+ 0
- 1
daemon/call.h View File

@ -443,7 +443,6 @@ struct call_stats {
struct callmaster *callmaster_new(struct poller *);
void stream_msg_mh_src(struct packet_stream *, struct msghdr *);
void callmaster_get_all_calls(struct callmaster *m, GQueue *q);


+ 2
- 16
daemon/dtls.c View File

@ -631,9 +631,7 @@ error:
int dtls(struct packet_stream *ps, const str *s, const endpoint_t *fsin) {
struct dtls_connection *d;
int ret;
unsigned char buf[0x10000], ctrl[256];
struct msghdr mh;
struct iovec iov;
unsigned char buf[0x10000];
if (!ps || !ps->selected_sfd)
return 0;
@ -705,19 +703,7 @@ int dtls(struct packet_stream *ps, const str *s, const endpoint_t *fsin) {
if (!fsin)
fsin = &ps->endpoint;
ZERO(mh);
mh.msg_control = ctrl;
mh.msg_controllen = sizeof(ctrl);
mh.msg_iov = &iov;
mh.msg_iovlen = 1;
ZERO(iov);
iov.iov_base = buf;
iov.iov_len = ret;
stream_msg_mh_src(ps, &mh);
socket_sendmsg(&ps->selected_sfd->socket, &mh, fsin);
socket_sendto(&ps->selected_sfd->socket, buf, ret, fsin);
return 0;
}


+ 13
- 14
daemon/ice.c View File

@ -620,7 +620,7 @@ static void __do_ice_check(struct ice_candidate_pair *pair) {
stun_binding_request(&pair->remote_candidate->endpoint, transact, &ag->pwd[0], ag->ufrag,
AGENT_ISSET(ag, CONTROLLING), tie_breaker,
prio, &pair->local_intf->spec->address.addr, &ps->selected_sfd->socket,
prio, &ps->selected_sfd->socket,
PAIR_ISSET(pair, TO_USE));
}
@ -1031,9 +1031,10 @@ static int __check_valid(struct ice_agent *ag) {
* -1 = generic error, process packet as normal
* -2 = role conflict
*/
int ice_request(struct packet_stream *ps, const endpoint_t *src, const sockaddr_t *dst,
int ice_request(struct stream_fd *sfd, const endpoint_t *src,
struct stun_attrs *attrs)
{
struct packet_stream *ps = sfd->stream;
struct call_media *media = ps->media;
struct ice_agent *ag;
const struct local_intf *ifa;
@ -1042,7 +1043,8 @@ int ice_request(struct packet_stream *ps, const endpoint_t *src, const sockaddr_
struct ice_candidate_pair *pair;
int ret;
__DBG("received ICE request from %s on %s", endpoint_print_buf(src), sockaddr_print_buf(dst));
__DBG("received ICE request from %s on %s", endpoint_print_buf(src),
endpoint_print_buf(&sfd->socket.local));
ag = media->ice_agent;
if (!ag)
@ -1050,10 +1052,7 @@ int ice_request(struct packet_stream *ps, const endpoint_t *src, const sockaddr_
atomic64_set(&ag->last_activity, poller_now);
ifa = get_interface_from_address(ag->logical_intf, dst, NULL); /* XXX type */
err = "ICE/STUN binding request received on unknown local interface address";
if (!ifa)
goto err;
ifa = sfd->local_intf;
/* determine candidate pair */
mutex_lock(&ag->lock);
@ -1115,8 +1114,8 @@ int ice_request(struct packet_stream *ps, const endpoint_t *src, const sockaddr_
err_unlock:
mutex_unlock(&ag->lock);
err:
ilog(LOG_NOTICE, "%s (from %s on interface %s)", err, endpoint_print_buf(src), sockaddr_print_buf(dst));
ilog(LOG_NOTICE, "%s (from %s on interface %s)", err, endpoint_print_buf(src),
endpoint_print_buf(&sfd->socket.local));
return 0;
}
@ -1140,11 +1139,12 @@ static int __check_succeeded_complete(struct ice_agent *ag) {
}
/* call is locked in R */
int ice_response(struct packet_stream *ps, const endpoint_t *src, const sockaddr_t *dst,
int ice_response(struct stream_fd *sfd, const endpoint_t *src,
struct stun_attrs *attrs, u_int32_t transaction[3])
{
struct ice_candidate_pair *pair, *opair;
struct ice_agent *ag;
struct packet_stream *ps = sfd->stream;
struct call_media *media = ps->media;
const char *err;
unsigned int component;
@ -1152,7 +1152,8 @@ int ice_response(struct packet_stream *ps, const endpoint_t *src, const sockaddr
const struct local_intf *ifa;
int ret, was_ctl;
__DBG("received ICE response from %s on %s", endpoint_print_buf(src), sockaddr_print_buf(dst));
__DBG("received ICE response from %s on %s", endpoint_print_buf(src),
endpoint_print_buf(&sfd->socket.local));
ag = media->ice_agent;
if (!ag)
@ -1183,8 +1184,6 @@ int ice_response(struct packet_stream *ps, const endpoint_t *src, const sockaddr
goto err;
err = "ICE/STUN response received, but destination address didn't match local interface address";
if (!sockaddr_eq(dst, &ifa->spec->address.addr)) /* XXX lots of references to this struct member */
goto err;
if (pair->packet_stream != ps)
goto err;
@ -1267,7 +1266,7 @@ err_unlock:
err:
if (err)
ilog(LOG_NOTICE, "%s (from %s on interface %s)",
err, endpoint_print_buf(src), sockaddr_print_buf(dst));
err, endpoint_print_buf(src), endpoint_print_buf(&sfd->socket.local));
if (pair && attrs->error_code)
__fail_pair(pair);


+ 2
- 2
daemon/ice.h View File

@ -159,8 +159,8 @@ void ice_remote_candidates(GQueue *, struct ice_agent *);
void ice_thread_run(void *);
int ice_request(struct packet_stream *, const endpoint_t *, const sockaddr_t *, struct stun_attrs *);
int ice_response(struct packet_stream *ps, const endpoint_t *src, const sockaddr_t *dst,
int ice_request(struct stream_fd *, const endpoint_t *, struct stun_attrs *);
int ice_response(struct stream_fd *, const endpoint_t *src,
struct stun_attrs *attrs, u_int32_t transaction[3]);
/* returns 0 if ICE still has work to do, 1 otherwise */


+ 5
- 63
daemon/media_socket.c View File

@ -827,7 +827,7 @@ noop:
/* XXX split this function into pieces */
/* called lock-free */
static int stream_packet(struct stream_fd *sfd, str *s, const endpoint_t *fsin, const sockaddr_t *dst) {
static int stream_packet(struct stream_fd *sfd, str *s, const endpoint_t *fsin) {
struct packet_stream *stream,
*sink = NULL,
*in_srtp, *out_srtp;
@ -835,9 +835,6 @@ static int stream_packet(struct stream_fd *sfd, str *s, const endpoint_t *fsin,
int ret = 0, update = 0, stun_ret = 0, handler_ret = 0, muxed_rtcp = 0, rtcp = 0,
unk = 0;
int i;
struct msghdr mh;
struct iovec iov;
unsigned char buf[256];
struct call *call;
struct callmaster *cm;
/*unsigned char cc;*/
@ -876,7 +873,7 @@ static int stream_packet(struct stream_fd *sfd, str *s, const endpoint_t *fsin,
}
if (media->ice_agent && is_stun(s)) {
stun_ret = stun(s, stream, fsin, dst);
stun_ret = stun(s, sfd, fsin);
if (!stun_ret)
goto unlock_out;
if (stun_ret == 1) {
@ -1102,23 +1099,10 @@ forward:
|| stun_ret || handler_ret < 0)
goto drop;
ZERO(mh);
mh.msg_control = buf;
mh.msg_controllen = sizeof(buf);
ret = socket_sendto(&sink->selected_sfd->socket, s->s, s->len, &sink->endpoint);
mutex_unlock(&sink->out_lock);
stream_msg_mh_src(sink, &mh);
ZERO(iov);
iov.iov_base = s->s;
iov.iov_len = s->len;
mh.msg_iov = &iov;
mh.msg_iovlen = 1;
ret = socket_sendmsg(&sink->selected_sfd->socket, &mh, &sink->endpoint);
if (ret == -1) {
ret = -errno;
ilog(LOG_DEBUG,"Error when sending message. Error: %s",strerror(errno));
@ -1164,19 +1148,10 @@ static void stream_fd_readable(int fd, void *p, uintptr_t u) {
struct stream_fd *sfd = p;
char buf[RTP_BUFFER_SIZE];
int ret, iters;
struct sockaddr_in6 sin6_src;
int update = 0;
struct call *ca;
str s;
struct msghdr mh;
struct iovec iov;
char control[128];
struct cmsghdr *cmh;
struct in6_pktinfo *pi6;
struct in6_addr /*dst_buf,*/ *dst;
//struct in_pktinfo *pi;
endpoint_t ep;
sockaddr_t sa;
if (sfd->socket.fd != fd)
goto out;
@ -1192,17 +1167,7 @@ static void stream_fd_readable(int fd, void *p, uintptr_t u) {
}
#endif
ZERO(mh);
mh.msg_name = &sin6_src;
mh.msg_namelen = sizeof(sin6_src);
mh.msg_iov = &iov;
mh.msg_iovlen = 1;
mh.msg_control = control;
mh.msg_controllen = sizeof(control);
iov.iov_base = buf + RTP_BUFFER_HEAD_ROOM;
iov.iov_len = MAX_RTP_PACKET_SIZE;
ret = recvmsg(fd, &mh, 0);
ret = socket_recvfrom(&sfd->socket, buf + RTP_BUFFER_HEAD_ROOM, MAX_RTP_PACKET_SIZE, &ep);
if (ret < 0) {
if (errno == EINTR)
@ -1215,31 +1180,8 @@ static void stream_fd_readable(int fd, void *p, uintptr_t u) {
if (ret >= MAX_RTP_PACKET_SIZE)
ilog(LOG_WARNING, "UDP packet possibly truncated");
for (cmh = CMSG_FIRSTHDR(&mh); cmh; cmh = CMSG_NXTHDR(&mh, cmh)) {
if (cmh->cmsg_level == IPPROTO_IPV6 && cmh->cmsg_type == IPV6_PKTINFO) {
pi6 = (void *) CMSG_DATA(cmh);
dst = &pi6->ipi6_addr;
goto got_dst;
}
// XXX
// if (cmh->cmsg_level == IPPROTO_IP && cmh->cmsg_type == IP_PKTINFO) {
// pi = (void *) CMSG_DATA(cmh);
// in4_to_6(&dst_buf, pi->ipi_addr.s_addr);
// dst = &dst_buf;
// goto got_dst;
// }
}
ilog(LOG_WARNING, "No pkt_info present in received UDP packet, cannot handle packet");
goto done;
got_dst:
str_init_len(&s, buf + RTP_BUFFER_HEAD_ROOM, ret);
// XXX
ep.port = ntohs(sin6_src.sin6_port);
ep.address.u.ipv6 = sin6_src.sin6_addr;
sa.u.ipv6 = *dst;
ret = stream_packet(sfd, &s, &ep, &sa);
ret = stream_packet(sfd, &s, &ep);
if (ret < 0) {
ilog(LOG_WARNING, "Write error on RTP socket: %s", strerror(-ret));
call_destroy(sfd->call);


+ 39
- 50
daemon/stun.c View File

@ -232,14 +232,10 @@ out:
}
static void output_init(struct msghdr *mh, struct iovec *iov,
struct header *hdr, unsigned short code, u_int32_t *transaction,
unsigned char *buf, int buflen)
struct header *hdr, unsigned short code, u_int32_t *transaction)
{
ZERO(*mh);
mh->msg_control = buf;
mh->msg_controllen = buflen;
mh->msg_iov = iov;
mh->msg_iovlen = 1;
@ -294,13 +290,8 @@ static void __output_finish(struct msghdr *mh) {
hdr = mh->msg_iov->iov_base;
hdr->msg_len = htons(hdr->msg_len);
}
//static void output_finish_ps(struct msghdr *mh, struct packet_stream *ps) {
// __output_finish(mh);
// stream_msg_mh_src(ps, mh);
//}
static void output_finish_src(struct msghdr *mh, const sockaddr_t *src) {
static void output_finish_src(struct msghdr *mh) {
__output_finish(mh);
msg_mh_src(src, mh);
}
static void fingerprint(struct msghdr *mh, struct fingerprint *fp) {
@ -353,7 +344,7 @@ static void integrity(struct msghdr *mh, struct msg_integrity *mi, str *pwd) {
hdr->msg_len = ntohs(hdr->msg_len);
}
static void stun_error_len(struct packet_stream *ps, const endpoint_t *sin, const sockaddr_t *dst,
static void stun_error_len(struct stream_fd *sfd, const endpoint_t *sin,
struct header *req,
int code, char *reason, int len, u_int16_t add_attr, void *attr_cont,
int attr_len)
@ -365,27 +356,26 @@ static void stun_error_len(struct packet_stream *ps, const endpoint_t *sin, cons
struct generic aa;
struct msghdr mh;
struct iovec iov[7]; /* hdr, ec, reason, aa, attr_cont, mi, fp */
unsigned char buf[256];
output_init(&mh, iov, &hdr, STUN_BINDING_ERROR_RESPONSE, req->transaction, buf, sizeof(buf));
output_init(&mh, iov, &hdr, STUN_BINDING_ERROR_RESPONSE, req->transaction);
ec.codes = htonl(((code / 100) << 8) | (code % 100));
output_add_data(&mh, &ec, STUN_ERROR_CODE, reason, len);
if (attr_cont)
output_add_data(&mh, &aa, add_attr, attr_cont, attr_len);
integrity(&mh, &mi, &ps->media->ice_agent->pwd[0]);
integrity(&mh, &mi, &sfd->stream->media->ice_agent->pwd[0]);
fingerprint(&mh, &fp);
output_finish_src(&mh, dst);
socket_sendmsg(&ps->selected_sfd->socket, &mh, sin);
output_finish_src(&mh);
socket_sendmsg(&sfd->socket, &mh, sin);
}
#define stun_error(ps, sin, dst, req, code, reason) \
stun_error_len(ps, sin, dst, req, code, reason "\0\0\0", strlen(reason), \
#define stun_error(sfd, sin, req, code, reason) \
stun_error_len(sfd, sin, req, code, reason "\0\0\0", strlen(reason), \
0, NULL, 0)
#define stun_error_attrs(ps, sin, dst, req, code, reason, type, content, len) \
stun_error_len(ps, sin, dst, req, code, reason "\0\0\0", strlen(reason), \
#define stun_error_attrs(sfd, sin, req, code, reason, type, content, len) \
stun_error_len(sfd, sin, req, code, reason "\0\0\0", strlen(reason), \
type, content, len)
@ -447,8 +437,8 @@ static int check_auth(str *msg, struct stun_attrs *attrs, struct call_media *med
}
/* XXX way too many parameters being passed around here, unify into a struct */
static int stun_binding_success(struct packet_stream *ps, struct header *req, struct stun_attrs *attrs,
const endpoint_t *sin, const sockaddr_t *dst)
static int stun_binding_success(struct stream_fd *sfd, struct header *req, struct stun_attrs *attrs,
const endpoint_t *sin)
{
struct header hdr;
struct xor_mapped_address xma;
@ -456,9 +446,8 @@ static int stun_binding_success(struct packet_stream *ps, struct header *req, st
struct fingerprint fp;
struct msghdr mh;
struct iovec iov[4]; /* hdr, xma, mi, fp */
unsigned char buf[256];
output_init(&mh, iov, &hdr, STUN_BINDING_SUCCESS_RESPONSE, req->transaction, buf, sizeof(buf));
output_init(&mh, iov, &hdr, STUN_BINDING_SUCCESS_RESPONSE, req->transaction);
xma.port = htons(sin->port) ^ (STUN_COOKIE >> 16);
if (sin->address.family->af == AF_INET) {
@ -475,11 +464,11 @@ static int stun_binding_success(struct packet_stream *ps, struct header *req, st
output_add(&mh, &xma, STUN_XOR_MAPPED_ADDRESS);
}
integrity(&mh, &mi, &ps->media->ice_agent->pwd[1]);
integrity(&mh, &mi, &sfd->stream->media->ice_agent->pwd[1]);
fingerprint(&mh, &fp);
output_finish_src(&mh, dst);
socket_sendmsg(&ps->selected_sfd->socket, &mh, sin);
output_finish_src(&mh);
socket_sendmsg(&sfd->socket, &mh, sin);
return 0;
}
@ -495,35 +484,35 @@ INLINE int u_int16_t_arr_len(u_int16_t *arr) {
#define SLF " from %s"
#define SLP endpoint_print_buf(sin)
static int __stun_request(struct packet_stream *ps, const endpoint_t *sin,
const sockaddr_t *dst, struct header *req, struct stun_attrs *attrs)
static int __stun_request(struct stream_fd *sfd, const endpoint_t *sin,
struct header *req, struct stun_attrs *attrs)
{
int ret;
ret = ice_request(ps, sin, dst, attrs);
ret = ice_request(sfd, sin, attrs);
if (ret == -2) {
ilog(LOG_DEBUG, "ICE role conflict detected");
stun_error(ps, sin, dst, req, 487, "Role conflict");
stun_error(sfd, sin, req, 487, "Role conflict");
return 0;
}
if (ret < 0)
return -1;
ilog(LOG_DEBUG, "Successful STUN binding request" SLF, SLP);
stun_binding_success(ps, req, attrs, sin, dst);
stun_binding_success(sfd, req, attrs, sin);
return ret;
}
static int __stun_success(struct packet_stream *ps, const endpoint_t *sin,
const sockaddr_t *dst, struct header *req, struct stun_attrs *attrs)
static int __stun_success(struct stream_fd *sfd, const endpoint_t *sin,
struct header *req, struct stun_attrs *attrs)
{
return ice_response(ps, sin, dst, attrs, req->transaction);
return ice_response(sfd, sin, attrs, req->transaction);
}
static int __stun_error(struct packet_stream *ps, const endpoint_t *sin,
const sockaddr_t *dst, struct header *req, struct stun_attrs *attrs)
static int __stun_error(struct stream_fd *sfd, const endpoint_t *sin,
struct header *req, struct stun_attrs *attrs)
{
return ice_response(ps, sin, dst, attrs, req->transaction);
return ice_response(sfd, sin, attrs, req->transaction);
}
@ -534,7 +523,7 @@ static int __stun_error(struct packet_stream *ps, const endpoint_t *sin,
*
* call is locked in R
*/
int stun(str *b, struct packet_stream *ps, const endpoint_t *sin, const sockaddr_t *dst) {
int stun(str *b, struct stream_fd *sfd, const endpoint_t *sin) {
struct header *req = (void *) b->s;
int msglen, method, class;
str attr_str;
@ -542,6 +531,7 @@ int stun(str *b, struct packet_stream *ps, const endpoint_t *sin, const sockaddr
u_int16_t unknowns[UNKNOWNS_COUNT];
const char *err;
int dst_idx, src_idx;
struct packet_stream *ps = sfd->stream;
msglen = ntohs(req->msg_len);
err = "message-length mismatch";
@ -565,7 +555,7 @@ int stun(str *b, struct packet_stream *ps, const endpoint_t *sin, const sockaddr
goto ignore;
ilog(LOG_WARNING, "STUN packet contained unknown "
"\"comprehension required\" attribute(s)" SLF, SLP);
stun_error_attrs(ps, sin, dst, req, 420, "Unknown attribute",
stun_error_attrs(sfd, sin, req, 420, "Unknown attribute",
STUN_UNKNOWN_ATTRIBUTES, unknowns,
u_int16_t_arr_len(unknowns) * 2);
return 0;
@ -598,11 +588,11 @@ int stun(str *b, struct packet_stream *ps, const endpoint_t *sin, const sockaddr
switch (class) {
case STUN_CLASS_REQUEST:
return __stun_request(ps, sin, dst, req, &attrs);
return __stun_request(sfd, sin, req, &attrs);
case STUN_CLASS_SUCCESS:
return __stun_success(ps, sin, dst, req, &attrs);
return __stun_success(sfd, sin, req, &attrs);
case STUN_CLASS_ERROR:
return __stun_error(ps, sin, dst, req, &attrs);
return __stun_error(sfd, sin, req, &attrs);
default:
return -1;
}
@ -610,11 +600,11 @@ int stun(str *b, struct packet_stream *ps, const endpoint_t *sin, const sockaddr
bad_req:
ilog(LOG_NOTICE, "Received invalid STUN packet" SLF ": %s", SLP, err);
stun_error(ps, sin, dst, req, 400, "Bad request");
stun_error(sfd, sin, req, 400, "Bad request");
return 0;
unauth:
ilog(LOG_NOTICE, "STUN authentication mismatch" SLF, SLP);
stun_error(ps, sin, dst, req, 401, "Unauthorized");
stun_error(sfd, sin, req, 401, "Unauthorized");
return 0;
ignore:
ilog(LOG_NOTICE, "Not handling potential STUN packet" SLF ": %s", SLP, err);
@ -623,12 +613,11 @@ ignore:
int stun_binding_request(const endpoint_t *dst, u_int32_t transaction[3], str *pwd,
str ufrags[2], int controlling, u_int64_t tiebreaker, u_int32_t priority,
const sockaddr_t *src, socket_t *sock, int to_use)
socket_t *sock, int to_use)
{
struct header hdr;
struct msghdr mh;
struct iovec iov[8]; /* hdr, username x2, ice_controlled/ing, priority, uc, fp, mi */
unsigned char buf[256];
char username_buf[256];
int i;
struct generic un_attr;
@ -638,7 +627,7 @@ int stun_binding_request(const endpoint_t *dst, u_int32_t transaction[3], str *p
struct fingerprint fp;
struct msg_integrity mi;
output_init(&mh, iov, &hdr, STUN_BINDING_REQUEST, transaction, buf, sizeof(buf));
output_init(&mh, iov, &hdr, STUN_BINDING_REQUEST, transaction);
i = snprintf(username_buf, sizeof(username_buf), STR_FORMAT":"STR_FORMAT,
STR_FMT(&ufrags[0]), STR_FMT(&ufrags[1]));
@ -658,7 +647,7 @@ int stun_binding_request(const endpoint_t *dst, u_int32_t transaction[3], str *p
integrity(&mh, &mi, pwd);
fingerprint(&mh, &fp);
output_finish_src(&mh, src);
output_finish_src(&mh);
socket_sendmsg(sock, &mh, dst);
return 0;


+ 2
- 2
daemon/stun.h View File

@ -49,10 +49,10 @@ INLINE int is_stun(const str *s) {
}
int stun(str *, struct packet_stream *, const endpoint_t *, const sockaddr_t *);
int stun(str *, struct stream_fd *, const endpoint_t *);
int stun_binding_request(const endpoint_t *dst, u_int32_t transaction[3], str *pwd,
str ufrags[2], int controlling, u_int64_t tiebreaker, u_int32_t priority,
const sockaddr_t *src, socket_t *, int);
socket_t *, int);
#endif

Loading…
Cancel
Save