## InfdXmppServer InfdXmppServer |

## Synopsis

                        InfdXmppServer;
    struct              InfdXmppServerClass;
    InfdXmppServer *    infd_xmpp_server_new                (InfdTcpServer *tcp,
                                                             InfXmppConnectionSecurityPolicy policy,
                                                             InfCertificateCredentials *creds,
                                                             InfSaslContext *sasl_context,
                                                             const gchar *sasl_mechanisms);
    void                infd_xmpp_server_set_security_policy
                                                            (InfdXmppServer *server,
                                                             InfXmppConnectionSecurityPolicy policy);
    InfXmppConnectionSecurityPolicy infd_xmpp_server_get_security_policy
                                                            (InfdXmppServer *server);

## Object Hierarchy

      GObject
       +----InfdXmppServer

## Implemented Interfaces

InfdXmppServer implements InfdXmlServer.

## Properties

      "credentials"              InfCertificateCredentials*  : Read / Write / Construct
      "local-hostname"           gchar*                : Read / Write / Construct Only
      "sasl-context"             InfSaslContext*       : Read / Write / Construct
      "sasl-mechanisms"          gchar*                : Read / Write / Construct
      "security-policy"          InfXmppConnectionSecurityPolicy  : Read / Write / Construct
      "tcp-server"               InfdTcpServer*        : Read / Write / Construct Only

## Signals

      "error"                                          : Run Last

## Description

## Details

### InfdXmppServer

    typedef struct _InfdXmppServer InfdXmppServer;

### struct InfdXmppServerClass

    struct InfdXmppServerClass {
      GObjectClass parent_class;

      /* Signals */
      void (*error)(InfdXmppServer* server,
                    GError* error);
    };

### infd_xmpp_server_new ()

    InfdXmppServer *    infd_xmpp_server_new                (InfdTcpServer *tcp,
                                                             InfXmppConnectionSecurityPolicy policy,
                                                             InfCertificateCredentials *creds,
                                                             InfSaslContext *sasl_context,
                                                             const gchar *sasl_mechanisms);

Creates a new InfdXmppServer with `tcp` as underlaying TCP server object. No attempt is being made to open `tcp`, if it is not already open. When a new connection comes in, the XMPP server creates a XMPP connection that may be used to communicate with the client. Note however that the resulting connection will be in status OPENING until authentication has completed.

If `policy` is `INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED`, then `creds` may be `NULL`. If `creds` is non-`NULL` nevertheless, then it is possible to change the security policy later using `infd_xmpp_server_set_security_policy()`. `creds` can also be changed later while the server is running. So just set valid credentials before changing `policy` to allow TLS.

If `sasl_context` is `NULL`, the server uses a built-in context that only supports ANONYMOUS authentication. If `sasl_context` is not `NULL`, then `sasl_mechanisms` specifies the mechanisms offered to clients. If `sasl_mechanisms` is `NULL`, then all available mechanims will be offered. If `sasl_context` is `NULL`, then this parameter is ignored.

`tcp` : | A InfdTcpServer.
`policy` : | The initial security policy.
`creds` : | Certificate credentials used to secure any communication.
`sasl_context` : | A SASL context used for authentication.
`sasl_mechanisms` : | A whitespace-sparated list of SASL mechanisms.
Returns : | A new InfdXmppServer.

### infd_xmpp_server_set_security_policy ()

    void                infd_xmpp_server_set_security_policy
                                                            (InfdXmppServer *server,
                                                             InfXmppConnectionSecurityPolicy policy);

Sets the security policy for newly accepted InfXmppConnections. Does not already established connections.

`server` : | A InfdXmppServer.
`policy` : | The new security policy.

### infd_xmpp_server_get_security_policy ()

    InfXmppConnectionSecurityPolicy infd_xmpp_server_get_security_policy
                                                            (InfdXmppServer *server);

Returns the current security policy for newly accepted InfXmppConnections.

`server` : | A InfdXmppServer.
Returns : | The current security policy.

## Property Details

### The `"credentials"` property

      "credentials"              InfCertificateCredentials*  : Read / Write / Construct

The certificate credentials for GnuTLS.

### The `"local-hostname"` property

      "local-hostname"           gchar*                : Read / Write / Construct Only

Hostname of the server.

Default value: NULL

### The `"sasl-context"` property

      "sasl-context"             InfSaslContext*       : Read / Write / Construct

The SASL context used for authentaction.

### The `"sasl-mechanisms"` property

      "sasl-mechanisms"          gchar*                : Read / Write / Construct

The SASL mechanisms offered to the client for authentication.

Default value: NULL

### The `"security-policy"` property

      "security-policy"          InfXmppConnectionSecurityPolicy  : Read / Write / Construct

Whether to offer or require TLS.

Default value: INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED

### The `"tcp-server"` property

      "tcp-server"               InfdTcpServer*        : Read / Write / Construct Only

Underlaying TCP server.

## Signal Details

### The `"error"` signal

    void                user_function                      (InfdXmppServer *infdxmppserver,
                                                            gpointer        arg1,
                                                            gpointer        user_data)           : Run Last

`infdxmppserver` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.