2 * Copyright (C) 2008 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "xmpp_internal.h"
23 sasl (hc_xmpp_t *xmpp, iks *f)
26 xmpp->sasl |= SUPPORTED;
27 for (c = iks_child (f); c != NULL; c = iks_next (c))
29 if (!iks_strcmp (iks_name (c), "optional"))
30 xmpp->sasl |= OPTIONAL;
31 else if (!iks_strcmp (iks_name (c), "required"))
32 xmpp->sasl |= REQUIRED;
37 tls (hc_xmpp_t *xmpp, iks *f)
40 xmpp->tls |= SUPPORTED;
41 for (c = iks_child (f); c != NULL; c = iks_next (c))
43 if (!iks_strcmp (iks_name (c), "optional"))
44 xmpp->tls |= OPTIONAL;
45 else if (!iks_strcmp (iks_name (c), "required"))
46 xmpp->tls |= REQUIRED;
51 hc_xmpp_features (hc_xmpp_t *xmpp, iks *features)
54 for (c = iks_child (features); c != NULL; c = iks_next (c))
56 if (!iks_strcmp (iks_name (c), "starttls") &&
57 !iks_strcmp (iks_find_attrib (c, "xmlns"), HC_XMPP_NS_TLS))
59 if (!iks_strcmp (iks_name (c), "mechanisms") &&
60 !iks_strcmp (iks_find_attrib (c, "xmlns"), HC_XMPP_NS_SASL))