msg_addr.h 2.22 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
/*
 * This file is part of the Sofia-SIP package
 *
 * Copyright (C) 2005 Nokia Corporation.
 *
 * Contact: Pekka Pessi <pekka.pessi@nokia.com>
 *
 * * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * 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 St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 */

#ifndef MSG_ADDR_H /** Defined when msg_addr.h has been included. */
#define MSG_ADDR_H \
"$Id: msg_addr.h,v 1.1.1.1 2005/07/20 20:35:22 kaiv Exp $"

/**@ingroup msg 
 * @file msg_addr.h 
 * @brief Addressing and I/O interface for messages.
 *
 * @author Pekka Pessi <Pekka.Pessi@nokia.com>
 *
 * @date Created: Thu Jun  8 19:28:55 2000 ppessi
 * $Date: 2005/07/20 20:35:22 $
 */

#ifndef MSG_H
#include <msg.h>
#endif
#ifndef SU_H
#include <su.h>
#endif

void msg_addr_zero(msg_t *msg);
su_addrinfo_t *msg_addrinfo(msg_t *msg);
su_sockaddr_t *msg_addr(msg_t *msg);
socklen_t *msg_addrlen(msg_t *msg);
void msg_addr_copy(msg_t *dst, msg_t const *src);

int msg_errno(msg_t const *msg);
void msg_set_errno(msg_t *msg, int err);

enum {
  msg_min_size = 512,
  msg_min_block = 8192,
  msg_n_fragments = 8
};

typedef struct su_iovec_s msg_iovec_t;
#define mv_base siv_base
#define mv_len  siv_len

int msg_iovec(msg_t *msg, msg_iovec_t vec[], int veclen);

int msg_recv_iovec(msg_t *msg, msg_iovec_t vec[], int veclen, unsigned n, 
		   int exact);
int msg_recv_commit(msg_t *msg, unsigned n, int eos);

int msg_recv_buffer(msg_t *msg, void **buffer);

msg_t *msg_next(msg_t *msg);

int msg_set_next(msg_t *msg, msg_t *next);

void msg_clear_committed(msg_t *msg);

int msg_buf_external(msg_t *msg, 
		     unsigned N, 
		     unsigned blocksize);


#endif /* !defined(MSG_ADDR_H) */