agent.h 1.27 KB
Newer Older
Dafydd Harries's avatar
Dafydd Harries committed
1 2 3 4

#ifndef _AGENT_H
#define _AGENT_H

5
#include <arpa/inet.h>
6

7 8 9
#include <glib.h>

#include "udp.h"
10
#include "address.h"
Dafydd Harries's avatar
Dafydd Harries committed
11
#include "candidate.h"
12
#include "event.h"
13

Dafydd Harries's avatar
Dafydd Harries committed
14
G_BEGIN_DECLS
15

16
typedef struct _NiceAgent NiceAgent;
Dafydd Harries's avatar
Dafydd Harries committed
17

18
struct _NiceAgent
Dafydd Harries's avatar
Dafydd Harries committed
19 20
{
  guint next_candidate_id;
Dafydd Harries's avatar
Dafydd Harries committed
21
  guint next_stream_id;
Dafydd Harries's avatar
Dafydd Harries committed
22
  NiceUDPSocketFactory *socket_factory;
Dafydd Harries's avatar
Dafydd Harries committed
23 24
  GSList *local_addresses;
  GSList *local_candidates;
25
  GSList *remote_candidates;
Dafydd Harries's avatar
Dafydd Harries committed
26 27 28 29 30
  GSList *streams;
  GSList *events;
};


31 32
typedef void (*NiceAgentRecvHandler) (
  NiceAgent *agent, guint stream_id, guint component_id, guint len,
33
  gchar *buf, gpointer user_data);
34 35


36
NiceAgent *
Dafydd Harries's avatar
Dafydd Harries committed
37
nice_agent_new (NiceUDPSocketFactory *factory);
38

39
NiceEvent *
40
nice_agent_pop_event (NiceAgent *agent);
41

Dafydd Harries's avatar
Dafydd Harries committed
42
void
43
nice_agent_add_local_address (NiceAgent *agent, NiceAddress *addr);
44

Dafydd Harries's avatar
Dafydd Harries committed
45
guint
46 47
nice_agent_add_stream (
  NiceAgent *agent,
48 49
  NiceAgentRecvHandler handle_recv,
  gpointer handle_recv_data);
50

Dafydd Harries's avatar
Dafydd Harries committed
51
void
52
nice_agent_free (NiceAgent *agent);
53

54
void
55 56
nice_agent_add_remote_candidate (
  NiceAgent *agent,
57 58
  guint stream_id,
  guint component_id,
59 60
  NiceCandidateType type,
  NiceAddress *addr,
61 62
  gchar *username,
  gchar *password);
63

Dafydd Harries's avatar
Dafydd Harries committed
64
void
65 66
nice_agent_recv (
  NiceAgent *agent,
Dafydd Harries's avatar
Dafydd Harries committed
67
  guint candidate_id);
68

69
const GSList *
70 71
nice_agent_get_local_candidates (
  NiceAgent *agent);
Dafydd Harries's avatar
Dafydd Harries committed
72

Dafydd Harries's avatar
Dafydd Harries committed
73 74
G_END_DECLS

Dafydd Harries's avatar
Dafydd Harries committed
75 76
#endif /* _AGENT_H */