Loading...
Searching...
No Matches
stun_common.h File Reference
`#include <sofia-sip/su_localinfo.h>`
Include dependency graph for stun_common.h:

Go to the source code of this file.

## Macros

#define | STUN_COMMON_H
| Defined when <sofia-sip/stun_common.h> has been included.
#define | STUN_A_LAST_MANDATORY
| largest attribute in the current spec (see above for exceptions for buggy servers)
#define | STUN_A_ALTERNATE_SERVER_DEP
| historic from early fc3489bis drafts
#define | STUN_A_BUGGYSERVER_XORONLY
| workaround for stund-0.94 and older
#define | STUN_A_BUGGYSERVER_SERVER
| workaround for stund-0.94 and older
#define | LARGEST_ATTRIBUTE
| deprecated API
#define | OPTIONAL_ATTRIBUTE
| deprecated API
#define | STUN_MAX_RETRX_INT
| max retrx interval in millisec
#define | STUN_DEFAULT_PORT
| from RFC3489

## Functions

stun_attr_t * | stun_get_attr (stun_attr_t *attr, uint16_t attr_type)
| scan thru attribute list and return the next requested attr
int | stun_encode_address (stun_attr_t *attr)
| The set of functions encodes the corresponding attribute to network format, and save the result to the enc_buf.
int | stun_encode_type_len (stun_attr_t *attr, uint16_t len)
| this function allocates the enc_buf, fills in type, length
int | stun_validate_message_integrity (stun_msg_t *msg, stun_buffer_t *pwd)
| Validate the message integrity based on given STUN password 'pwd'.
int | stun_encode_message (stun_msg_t *msg, stun_buffer_t *pwd)
| Send a STUN message.
char * | stun_determine_ip_address (int family)
| Determines and returns local IP address.

## Detailed Description

Author
  Tat Chan Tat.C.nosp@m.han@.nosp@m.nokia.nosp@m..com

Date
  Created: Fri Oct 3 13:39:55 2003 ppessi

## Function Documentation

## stun_determine_ip_address()

char * stun_determine_ip_address | ( | int | family | ) |

Determines and returns local IP address.

Address is determined using su_getlocalinfo() function.

Parameters

  family | network address family in use

Returns
  local ip address

## stun_encode_address()

int stun_encode_address | ( | stun_attr_t * | attr | ) |

The set of functions encodes the corresponding attribute to network format, and save the result to the enc_buf.

Return the size of the buffer.

## stun_encode_message()

int stun_encode_message | ( | stun_msg_t * | msg,
|  | stun_buffer_t * | pwd )

Send a STUN message.

This will convert the stun_msg_t to the binary format based on the spec

## stun_validate_message_integrity()

int stun_validate_message_integrity | ( | stun_msg_t * | msg,
|  | stun_buffer_t * | pwd )

Validate the message integrity based on given STUN password 'pwd'.

The received content should be in msg->enc_buf.

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.