su.c File Reference


Detailed Description

OS-independent socket functions.

Author:
Pekka Pessi <Pekka.Pessi@nokia-email.address.hidden>
Date:
Created: Thu Mar 18 19:40:51 1999 pessi

#include "config.h"
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include "sofia-sip/su.h"
#include "sofia-sip/su_log.h"
#include "sofia-sip/su_alloc.h"

Include dependency graph for su.c:


Functions

su_socket_t su_socket (int af, int sock, int proto)
 Create an endpoint for communication.
int su_soerror (su_socket_t s)
 Get the error code associated with the socket.
int su_setreuseaddr (su_socket_t s, int reuse)
 Set/reset address reusing option.
int su_getmsgsize (su_socket_t s)
 Get size of message available in socket.
int su_vsend (su_socket_t s, su_iovec_t const iov[], int iovlen, int flags, su_sockaddr_t const *su, socklen_t sulen)
 Scatter-gather send.
int su_vrecv (su_socket_t s, su_iovec_t iov[], int iovlen, int flags, su_sockaddr_t *su, socklen_t *sulen)
 Scatter-gather receive.
int su_cmp_sockaddr (su_sockaddr_t const *a, su_sockaddr_t const *b)
 Compare two socket addresses.
int su_match_sockaddr (su_sockaddr_t const *a, su_sockaddr_t const *b)
 Check if socket address b match with a.
void su_canonize_sockaddr (su_sockaddr_t *su)
 Convert mapped/compat address to IPv4 address.

Function Documentation

int su_match_sockaddr ( su_sockaddr_t const *  a,
su_sockaddr_t const *  b 
)

Check if socket address b match with a.

The function su_match_sockaddr() returns true if the socket address b matches with the socket address a. This happens if either all the interesting fields are identical: address family, port number, address, and scope ID (in case of IPv6) or that the a contains a wildcard (zero) in their place.


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