teleport-peer.h 1.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* teleport-peer.h
 *
 * Copyright 2017 Julian Sparber <julian@sparber.com>
 *
 * Teleport is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

19 20
#ifndef __TELEPORT_PEER_H
#define __TELEPORT_PEER_H
21 22 23 24 25 26

#include <gtk/gtk.h>

#define TELEPORT_TYPE_PEER teleport_peer_get_type ()
G_DECLARE_FINAL_TYPE (TeleportPeer, teleport_peer, TELEPORT, PEER, GObject)

27 28 29 30 31 32 33
typedef struct Peers {
  char *name;
  char *ip;
  gint port;
} Peer;


34 35
gchar * teleport_peer_get_name (TeleportPeer  *self, gint index, GError **error);
gchar * teleport_peer_get_ip (TeleportPeer  *self, gint index, GError **error);
36 37
gint teleport_peer_get_port (TeleportPeer  *self, gint index, GError **error);
void teleport_peer_add_peer (TeleportPeer *self, gchar * name, gchar * ip, gint port);
38
void teleport_peer_remove_peer (TeleportPeer *, Peer *);
39 40
void teleport_peer_remove_peer_by_name (TeleportPeer *, const gchar *);
gchar * teleport_peer_get_name_by_addr (TeleportPeer *, const gchar *);
41
int  teleport_peer_get_number (TeleportPeer *self);
42

43
#endif /* __TELEPORT_PEER_H */