ccn_sockcreate.c File Reference

Setting up a socket from a text-based description. More...

Go to the source code of this file.

Defines

#define LOGGIT   if (logger) (*logger)
#define GOT_HERE   LOGGIT(logdat, "at ccn_sockcreate.c:%d", __LINE__);

Functions

static int set_multicast_socket_options (int socket_r, int socket_w, struct addrinfo *ai, struct addrinfo *localif_for_mcast_addrinfo, int multicastttl, int ifindex, void(*logger)(void *, const char *,...), void *logdat)
int ccn_setup_socket (const struct ccn_sockdescr *descr, void(*logger)(void *, const char *,...), void *logdat, int(*getbound)(void *, struct sockaddr *, socklen_t), void *getbounddat, struct ccn_sockets *socks)
 Utility for setting up a socket (or pair of sockets) from a text-based description.


Detailed Description

Setting up a socket from a text-based description.

Part of the CCNx C Library.

Copyright (C) 2009-2010 Palo Alto Research Center, Inc.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Definition in file ccn_sockcreate.c.


Define Documentation

#define GOT_HERE   LOGGIT(logdat, "at ccn_sockcreate.c:%d", __LINE__);

Definition at line 42 of file ccn_sockcreate.c.

Referenced by ccn_setup_socket(), and incoming_content().

#define LOGGIT   if (logger) (*logger)

Definition at line 41 of file ccn_sockcreate.c.

Referenced by ccn_setup_socket(), and set_multicast_socket_options().


Function Documentation

int ccn_setup_socket ( const struct ccn_sockdescr descr,
void(*)(void *, const char *,...)  logger,
void *  logdat,
int(*)(void *, struct sockaddr *, socklen_t)  getbound,
void *  getbounddat,
struct ccn_sockets socks 
)

Utility for setting up a socket (or pair of sockets) from a text-based description.

Currently this is only used for UDP multicast.

Parameters:
descr hold the information needed to create the socket(s).
logger should be used for reporting errors, printf-style.
logdat must be passed as first argument to logger().
getbound is callback for getting already-bound sender socket, should return -1 if none.
getbounddat is passed as first argument to getbound
socks will be filled in with the pair of socket file descriptors.
Returns:
0 for success, -1 for error.

Definition at line 172 of file ccn_sockcreate.c.

Referenced by setup_multicast().

static int set_multicast_socket_options ( int  socket_r,
int  socket_w,
struct addrinfo *  ai,
struct addrinfo *  localif_for_mcast_addrinfo,
int  multicastttl,
int  ifindex,
void(*)(void *, const char *,...)  logger,
void *  logdat 
) [static]

Definition at line 46 of file ccn_sockcreate.c.

Referenced by ccn_setup_socket().


Generated on Thu Feb 16 00:44:23 2012 for Content-Centric Networking in C by  doxygen 1.5.6