mirror of https://github.com/sipwise/rtpengine.git
parent
189c19eb03
commit
ab24a79de9
@ -0,0 +1,30 @@
|
||||
#include "control_ng.h"
|
||||
#include "obj.h"
|
||||
#include "poller.h"
|
||||
#include "bencode.h"
|
||||
|
||||
|
||||
static void control_ng_incoming(int fd, void *p, uintptr_t x) {
|
||||
}
|
||||
|
||||
struct control_ng *control_ng_new(struct poller *p, struct in6_addr ip, u_int16_t port, struct callmaster *m) {
|
||||
struct control_ng *c;
|
||||
|
||||
if (!p || !m)
|
||||
return NULL;
|
||||
|
||||
c = obj_alloc0("control_ng", sizeof(*c), NULL);
|
||||
|
||||
c->callmaster = m;
|
||||
cookie_cache_init(&c->cookie_cache);
|
||||
|
||||
if (udp_listener_init(&c->udp_listener, p, ip, port, control_ng_incoming, &c->obj))
|
||||
goto fail2;
|
||||
|
||||
return c;
|
||||
|
||||
fail2:
|
||||
obj_put(c);
|
||||
return NULL;
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
#ifndef _CONTROL_NG_H_
|
||||
#define _CONTROL_NG_H_
|
||||
|
||||
#include "obj.h"
|
||||
#include "cookie_cache.h"
|
||||
#include "udp_listener.h"
|
||||
|
||||
|
||||
struct poller;
|
||||
struct callmaster;
|
||||
|
||||
struct control_ng {
|
||||
struct obj obj;
|
||||
struct callmaster *callmaster;
|
||||
struct cookie_cache cookie_cache;
|
||||
struct udp_listener udp_listener;
|
||||
};
|
||||
|
||||
struct control_ng *control_ng_new(struct poller *, struct in6_addr, u_int16_t, struct callmaster *);
|
||||
|
||||
|
||||
#endif
|
Loading…
Reference in new issue