loudmouth/lm-sasl.h
author Senko Rasic <senko.rasic@collabora.co.uk>
Sun, 30 Nov 2008 10:20:08 +0100
changeset 575 daad23d59b56
parent 332 6b6ad42cd508
child 515 fb0f1adfa271
permissions -rw-r--r--
Don't check for sync dns problems when using asyncns [#33] lm_socket_create() checks for sync DNS failure, but the check is executed even if Loudmouth is using asyncns, in which case Loudmouth crashes. committer: Mikael Hallendal <micke@imendio.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
216
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     2
/*
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     3
 * Copyright (C) 2007 Collabora Ltd.
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     4
 *
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     6
 * modify it under the terms of the GNU Lesser General Public License as
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     7
 * published by the Free Software Foundation; either version 2 of the
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     8
 * License, or (at your option) any later version.
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     9
 *
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    13
 * Lesser General Public License for more details.
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    14
 *
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    15
 * You should have received a copy of the GNU Lesser General Public
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    16
 * License along with this program; if not, write to the
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    18
 * Boston, MA 02111-1307, USA.
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    19
 */
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    20
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    21
#ifndef __LM_SASL_H__
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    22
#define __LM_SASL_H__
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    23
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    24
#if !defined (LM_INSIDE_LOUDMOUTH_H) && !defined (LM_COMPILATION)
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    25
#error "Only <loudmouth/loudmouth.h> can be included directly, this file may disappear or change contents."
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    26
#endif
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    27
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    28
#include <glib.h>
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    29
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    30
G_BEGIN_DECLS
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    31
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    32
typedef struct _LmSASL LmSASL;
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    33
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    34
typedef void (*LmSASLResultHandler) (LmSASL *sasl,
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    35
				     LmConnection *connection,
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    36
				     gboolean success,
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    37
				     const gchar *reason);
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    38
255
704881ac7788 Fixed potential problem if auth was not called from the open callback.
Mikael Hallendal <micke@imendio.com>
parents: 216
diff changeset
    39
LmSASL *lm_sasl_new (LmConnection *connection);
704881ac7788 Fixed potential problem if auth was not called from the open callback.
Mikael Hallendal <micke@imendio.com>
parents: 216
diff changeset
    40
704881ac7788 Fixed potential problem if auth was not called from the open callback.
Mikael Hallendal <micke@imendio.com>
parents: 216
diff changeset
    41
void lm_sasl_authenticate (LmSASL *sasl, 
704881ac7788 Fixed potential problem if auth was not called from the open callback.
Mikael Hallendal <micke@imendio.com>
parents: 216
diff changeset
    42
			   const gchar *username,
704881ac7788 Fixed potential problem if auth was not called from the open callback.
Mikael Hallendal <micke@imendio.com>
parents: 216
diff changeset
    43
			   const gchar *password,
704881ac7788 Fixed potential problem if auth was not called from the open callback.
Mikael Hallendal <micke@imendio.com>
parents: 216
diff changeset
    44
			   const gchar *server,
704881ac7788 Fixed potential problem if auth was not called from the open callback.
Mikael Hallendal <micke@imendio.com>
parents: 216
diff changeset
    45
			   LmSASLResultHandler handler);
216
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    46
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    47
void lm_sasl_free (LmSASL *sasl);
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    48
332
6b6ad42cd508 Support obsolete XEP-0078 (old-style jabber auth for XMPP1.0).
Senko Rasic <senko@phyrexia.lan>
parents: 255
diff changeset
    49
void
6b6ad42cd508 Support obsolete XEP-0078 (old-style jabber auth for XMPP1.0).
Senko Rasic <senko@phyrexia.lan>
parents: 255
diff changeset
    50
lm_sasl_get_auth_params (LmSASL *sasl, const gchar **username,
6b6ad42cd508 Support obsolete XEP-0078 (old-style jabber auth for XMPP1.0).
Senko Rasic <senko@phyrexia.lan>
parents: 255
diff changeset
    51
	const gchar **password);
6b6ad42cd508 Support obsolete XEP-0078 (old-style jabber auth for XMPP1.0).
Senko Rasic <senko@phyrexia.lan>
parents: 255
diff changeset
    52
216
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    53
G_END_DECLS
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    54
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    55
#endif /* __LM_SASL_H__ */
fab18da0956b Added lm-sasl.[ch] from Senko
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    56