## FsCandidate

FsCandidate — Structure describing a transport candidate.

## Functions

FsCandidate * | fs_candidate_new ()
FsCandidate * | fs_candidate_new_full ()
void | fs_candidate_destroy ()
FsCandidate * | fs_candidate_copy ()
void | fs_candidate_list_destroy ()
GList * | fs_candidate_list_copy ()
void | fs_value_set_candidate_list ()

## Types and Values

struct | FsCandidate
enum | FsCandidateType
enum | FsNetworkProtocol
enum | FsComponentType

## Includes

    #include <farstream/fs-conference.h>

## Description

An FsCandidate is a way to exchange candidate information between the client and Farstream. This description is compatible with ICE-13. It can also be a multicast address. Candidates are linked to streams. The information specified in this structure is usually representative of the codec information exchanged in the signaling.

## Functions

### fs_candidate_new ()

    FsCandidate *
    fs_candidate_new (const gchar *foundation,
                      guint component_id,
                      FsCandidateType type,
                      FsNetworkProtocol proto,
                      const gchar *ip,
                      guint port);

Allocates a new FsCandidate, the rest of the fields can be optionally filled manually. See also `fs_candidate_new_full()`

#### Parameters

foundation | The foundation of the candidate |
component_id | The component this candidate is for |
type | The type of candidate |
proto | The protocol this component is for |
ip | The IP address of this component (can be NULL for local candidate to mean any address). | [allow-none]
port | the UDP/TCP port |

#### Returns

a newly-allocated FsCandidate

### fs_candidate_new_full ()

    FsCandidate *
    fs_candidate_new_full (const gchar *foundation,
                           guint component_id,
                           const gchar *ip,
                           guint16 port,
                           const gchar *base_ip,
                           guint16 base_port,
                           FsNetworkProtocol proto,
                           guint32 priority,
                           FsCandidateType type,
                           const gchar *username,
                           const gchar *password,
                           guint ttl);

Allocates a new FsCandidate, filling all the fields. See also `fs_candidate_new()`

#### Parameters

foundation | The foundation of the candidate |
component_id | The component this candidate is for |
ip | The IP address of this component (can be NULL for local candidate to mean any address). | [allow-none]
port | the UDP/TCP port |
base_ip | IP of base in dotted format as defined in ICE-19. | [allow-none]
base_port | Port of base as defined in ICE-19. |
proto | The protocol this component is for |
priority | Value between 0 and (2^31 - 1) representing the priority |
type | The type of candidate |
username | Username to use to connect to client if necessary, NULL otherwise. | [allow-none]
password | Username to use to connect to client if necessary, NULL otherwise. | [allow-none]
ttl | The TTL used when sending Multicast packet (0 = auto) |

#### Returns

a newly-allocated FsCandidate

### fs_candidate_destroy ()

    void
    fs_candidate_destroy (FsCandidate *cand);

Frees a FsCandidate and all its contents

#### Parameters

cand | a FsCandidate to delete |

### fs_candidate_copy ()

    FsCandidate *
    fs_candidate_copy (const FsCandidate *cand);

Copies a FsCandidate and its contents.

#### Parameters

cand | a FsCandidate to copy |

#### Returns

a new FsCandidate

### fs_candidate_list_destroy ()

    void
    fs_candidate_list_destroy (GList *candidate_list);

Deletes a GList of FsCandidate and its contents

#### Parameters

candidate_list | A GList of FsCandidate |

### fs_candidate_list_copy ()

    GList *
    fs_candidate_list_copy (const GList *candidate_list);

Copies a GList of FsCandidate and its contents

#### Parameters

candidate_list | A GList of FsCandidate. | [element-type FsCodec]

#### Returns

a new GList of FsCandidate.

[element-type FsCodec][transfer full]

### fs_value_set_candidate_list ()

    void
    fs_value_set_candidate_list (GValue *value,
                                 GList *candidates);

This is for the bindings benefit. Works around the limitations of GObject introspection.

#### Parameters

value | a GValue of type FS_TYPE_CANDIDATE_LIST |
candidates | A GList of FsCandidate. | [element-type FsCandidate][allow-none]

## Types and Values

### struct FsCandidate

    struct FsCandidate {
      gchar *foundation;
      guint component_id;
      gchar *ip;
      guint16 port;
      gchar *base_ip;
      guint16 base_port;
      FsNetworkProtocol proto;
      guint32 priority;
      FsCandidateType type;
      gchar *username;
      gchar *password;
      guint ttl;
    };

Struct to hold information about ICE-19 compliant candidates

#### Members

gchar *`foundation`; | a string representing the foundation of this candidate (maximum 32 chars) |
guint `component_id`; | value between 1 and 256 indicating which component this candidate represents (1 is RTP, 2 is RTCP, FsComponentType can be used here) |
gchar *`ip`; | IP in dotted format |
guint16 `port`; | Port to use |
gchar *`base_ip`; | IP of base in dotted format as defined in ICE-19. |
guint16 `base_port`; | Port of base as defined in ICE-19. |
FsNetworkProtocol `proto`; | FsNetworkProtocol for ip protocol to use as candidate |
guint32 `priority`; | Value between 0 and (2^31 - 1) representing the priority |
FsCandidateType `type`; | The FsCandidateType of the candidate |
gchar *`username`; | Username to use to connect to client if necessary, NULL otherwise |
gchar *`password`; | Username to use to connect to client if necessary, NULL otherwise |
guint `ttl`; | The TTL used when sending Multicast packet (0 = auto) |

### enum FsCandidateType

An enum for the type of candidate used/reported

#### Members

FS_CANDIDATE_TYPE_HOST | A host candidate (local) |
FS_CANDIDATE_TYPE_SRFLX | A server reflexive candidate. |
FS_CANDIDATE_TYPE_PRFLX | A peer reflexive candidate |
FS_CANDIDATE_TYPE_RELAY | An relay candidate |
FS_CANDIDATE_TYPE_MULTICAST | A multicast address |

### enum FsNetworkProtocol

An enum for the base IP protocol

#### Members

FS_NETWORK_PROTOCOL_UDP | A UDP based protocol |
FS_NETWORK_PROTOCOL_TCP | A TCP based protocol, will listen for incoming connections |
FS_NETWORK_PROTOCOL_TCP_PASSIVE | A TCP based protocol, will listen for incoming connections |
FS_NETWORK_PROTOCOL_TCP_ACTIVE | A TCP based protocol, will attempt to open an outbound connection |
FS_NETWORK_PROTOCOL_TCP_SO | A TCP based protocol, will listen for incoming connections and attempt an outbound connection at the same time as the peer (Simultanuous-Open) |

### enum FsComponentType

This enum contains the component IDs defined in ICE-19

#### Members

FS_COMPONENT_NONE | Use this when specifying a component is innapropriate |
FS_COMPONENT_RTP | This component is for RTP data |
FS_COMPONENT_RTCP | This component is for RTCP control |