Loading...
Searching...
No Matches
msg_addr.h
Go to the documentation of this file.
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
*
* 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
#define MSG_ADDR_H
#ifndef MSG_H
#include <sofia-sip/msg.h>
#endif
#ifndef SU_H
#include <sofia-sip/su.h>
#endif
SOFIA_BEGIN_DECLS
SOFIAPUBFUN void msg_addr_zero(msg_t *msg);
SOFIAPUBFUN su_addrinfo_t *msg_addrinfo(msg_t *msg);
SOFIAPUBFUN su_sockaddr_t *msg_addr(msg_t *msg);
SOFIAPUBFUN int msg_get_address(msg_t *msg, su_sockaddr_t *, socklen_t *);
SOFIAPUBFUN int msg_set_address(msg_t *msg, su_sockaddr_t const *, socklen_t);
SOFIAPUBFUN void msg_addr_copy(msg_t *dst, msg_t const *src);
SOFIAPUBFUN int msg_errno(msg_t const *msg);
SOFIAPUBFUN 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
SOFIAPUBFUN isize_t msg_iovec(msg_t *msg, msg_iovec_t vec[], isize_t veclen);
SOFIAPUBFUN issize_t msg_recv_iovec(msg_t *msg,
msg_iovec_t vec[], isize_t veclen, usize_t n,
int exact);
SOFIAPUBFUN isize_t msg_recv_commit(msg_t *msg, usize_t n, int eos);
SOFIAPUBFUN issize_t msg_recv_buffer(msg_t *msg, void **return_buffer);
SOFIAPUBFUN msg_t *msg_next(msg_t *msg);
SOFIAPUBFUN int msg_set_next(msg_t *msg, msg_t *next);
SOFIAPUBFUN void msg_clear_committed(msg_t *msg);
SOFIAPUBFUN issize_t msg_buf_external(msg_t *msg,
usize_t N,
usize_t blocksize);
SOFIA_END_DECLS
#endif /* !defined(MSG_ADDR_H) */
msg.h
Base message interface.
msg_get_address
int msg_get_address(msg_t *msg, su_sockaddr_t *, socklen_t *)
Get message address.
Definition msg.c:303
msg_buf_external
issize_t msg_buf_external(msg_t *msg, usize_t N, usize_t blocksize)
Allocate a list of external buffers.
Definition msg_parser.c:738
msg_set_address
int msg_set_address(msg_t *msg, su_sockaddr_t const *, socklen_t)
Set message address.
Definition msg.c:329
msg_iovec_t
struct su_iovec_s msg_iovec_t
I/O vector type.
Definition msg_addr.h:72
msg_recv_commit
isize_t msg_recv_commit(msg_t *msg, usize_t n, int eos)
Commit n bytes of buffers.
Definition msg_parser.c:527
msg_iovec
isize_t msg_iovec(msg_t *msg, msg_iovec_t vec[], isize_t veclen)
Fill an I/O vector with message contents.
Definition msg_parser.c:2069
msg_n_fragments
@ msg_n_fragments
Number of external buffers.
Definition msg_addr.h:66
msg_min_size
@ msg_min_size
Minimum size of a message buffer.
Definition msg_addr.h:62
msg_min_block
@ msg_min_block
Minimum size of external buffer.
Definition msg_addr.h:64
msg_recv_iovec
issize_t msg_recv_iovec(msg_t *msg, msg_iovec_t vec[], isize_t veclen, usize_t n, int exact)
Obtain I/O vector for receiving the data.
Definition msg_parser.c:339
msg_addr_zero
void msg_addr_zero(msg_t *msg)
Zero the message address.
Definition msg.c:269
msg_clear_committed
void msg_clear_committed(msg_t *msg)
Clear committed data.
Definition msg_parser.c:608
msg_recv_buffer
issize_t msg_recv_buffer(msg_t *msg, void **return_buffer)
Obtain a buffer for receiving data.
Definition msg_parser.c:470
msg_set_errno
void msg_set_errno(msg_t *msg, int err)
Set error number associated with message.
Definition msg.c:431
msg_set_next
int msg_set_next(msg_t *msg, msg_t *next)
Set next message of the stream.
Definition msg_parser.c:591
msg_next
msg_t * msg_next(msg_t *msg)
Get a next message of the stream.
Definition msg_parser.c:564
msg_addrinfo
su_addrinfo_t * msg_addrinfo(msg_t *msg)
Get addrinfo structure.
Definition msg.c:354
msg_errno
int msg_errno(msg_t const *msg)
Get error number associated with message.
Definition msg.c:418
msg_addr
su_sockaddr_t * msg_addr(msg_t *msg)
Get pointer to socket address structure.
Definition msg.c:284
msg_addr_copy
void msg_addr_copy(msg_t *dst, msg_t const *src)
Copy message address.
Definition msg.c:371
msg_t
struct msg_s msg_t
Message object.
Definition msg_types.h:54
su_iovec_s
su.h
su_addrinfo_t
struct addrinfo su_addrinfo_t
SOFIAPUBFUN
#define SOFIAPUBFUN

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