~noskcaj/ubuntu/trusty/ekiga/ftbfs

« back to all changes in this revision

Viewing changes to src/clients/avahi.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-01-28 18:49:20 UTC
  • Revision ID: james.westby@ubuntu.com-20060128184920-v525ihmiv7id40xs
Tags: upstream-1.99.0
ImportĀ upstreamĀ versionĀ 1.99.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* GnomeMeeting -- A Video-Conferencing application
 
3
 * Copyright (C) 2000-2006 Damien Sandras
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
 *
 
19
 *
 
20
 * GnomeMeting is licensed under the GPL license and as a special exception,
 
21
 * you have permission to link or otherwise combine this program with the
 
22
 * programs OpenH323 and Pwlib, and distribute the combination, without
 
23
 * applying the requirements of the GNU GPL to the OpenH323 program, as long
 
24
 * as you do follow the requirements of the GNU GPL for all the rest of the
 
25
 * software thus combined.
 
26
 */
 
27
 
 
28
/*
 
29
 *                         avahi_publish.h  -  description
 
30
 *                         ------------------------------------
 
31
 *   begin                : Sun Aug 21 2005
 
32
 *   copyright            : (C) 2005 by Sebastien Estienne 
 
33
 *   description          : This file contains the Avahi zeroconf publisher. 
 
34
 *
 
35
 */
 
36
 
 
37
 
 
38
#include "common.h"
 
39
 
 
40
#ifndef _AVAHI_PUBLISHER_H_
 
41
#define _AVAHI_PUBLISHER_H_
 
42
 
 
43
#include <avahi-client/client.h>
 
44
#include <avahi-client/publish.h>
 
45
#include <avahi-common/alternative.h>
 
46
#include <avahi-common/malloc.h>
 
47
#include <avahi-common/error.h>
 
48
#include <avahi-common/timeval.h>
 
49
#include <avahi-glib/glib-watch.h>
 
50
 
 
51
 
 
52
/* Zeroconf Service Type */
 
53
#define ZC_H323 "_h323._tcp"
 
54
#define ZC_SIP "_sip._udp"
 
55
 
 
56
class GMManager;
 
57
 
 
58
 
 
59
class GMZeroconfPublisher
 
60
{
 
61
 
 
62
 public:
 
63
 
 
64
  /* DESCRIPTION  : / 
 
65
   * BEHAVIOR     : ZeroconfPublisher constructor
 
66
   *                - insert Avahi in Gnomemeeting Mainloop
 
67
   *                - initialization of some variables
 
68
   * PRE          : /
 
69
   */
 
70
  GMZeroconfPublisher (GMManager &);
 
71
 
 
72
 
 
73
  /* DESCRIPTION  : ZeroconfPublisher destructor 
 
74
   * BEHAVIOR     : 
 
75
   *                - Free avahi Client and Entry group
 
76
   *                - Stop publishing the gnomemeeting zeroconf service
 
77
   *                - free text_record.
 
78
   * PRE          : /
 
79
   */
 
80
  ~GMZeroconfPublisher ();
 
81
 
 
82
 
 
83
  /* DESCRIPTION  : / 
 
84
   * BEHAVIOR     : Return -1 when error occured, 0 if no error.
 
85
   *                Publish the gnomemeeting zeroconf service
 
86
   *                with data store in class attributes info.
 
87
   * PRE          : Start() method must be called before Publish ().
 
88
   */
 
89
  int Publish ();
 
90
  
 
91
  
 
92
  void ClientCallback (AvahiClient *c, 
 
93
                       AvahiClientState state, 
 
94
                       void *userdata);
 
95
  
 
96
  
 
97
  int CreateServices (AvahiClient *c, 
 
98
                      void *userdata);
 
99
 
 
100
  
 
101
  void EntryGroupCallback (AvahiEntryGroup *group, 
 
102
                           AvahiEntryGroupState state, 
 
103
                           void *userdata);
 
104
 
 
105
 private:
 
106
 
 
107
  AvahiClient *client;
 
108
  AvahiEntryGroup *group;
 
109
  
 
110
  char *name;                         /* Srv Record */
 
111
  
 
112
  AvahiStringList *h323_text_record;  /* H323 Txt Record */
 
113
  AvahiStringList *sip_text_record;   /* Sip Txt Record */
 
114
  
 
115
  uint16_t h323_port;                 /* port number of Srv Record */
 
116
  uint16_t sip_port;                  /* port number of Srv Record */
 
117
  
 
118
  AvahiGLibPoll *glib_poll;
 
119
  const AvahiPoll *poll_api;
 
120
 
 
121
  /* DESCRIPTION  : / 
 
122
   * BEHAVIOR     : Return err=SW_OKAY when no error occured.
 
123
   *                Retrieve user personal data from gmconf 
 
124
   *                to class attributes info.
 
125
   * PRE          : must be call to update personal data
 
126
   */
 
127
  int GetPersonalData();
 
128
 
 
129
  GMManager & manager;
 
130
};
 
131
 
 
132
#endif