|
Packit |
61cb5a |
/*
|
|
Packit |
61cb5a |
* Copyright (c) 2010-2011, Red Hat, Inc.
|
|
Packit |
61cb5a |
*
|
|
Packit |
61cb5a |
* Permission to use, copy, modify, and/or distribute this software for any
|
|
Packit |
61cb5a |
* purpose with or without fee is hereby granted, provided that the above
|
|
Packit |
61cb5a |
* copyright notice and this permission notice appear in all copies.
|
|
Packit |
61cb5a |
*
|
|
Packit |
61cb5a |
* THE SOFTWARE IS PROVIDED "AS IS" AND RED HAT, INC. DISCLAIMS ALL WARRANTIES
|
|
Packit |
61cb5a |
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
|
Packit |
61cb5a |
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL RED HAT, INC. BE LIABLE
|
|
Packit |
61cb5a |
* FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
Packit |
61cb5a |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
Packit |
61cb5a |
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
Packit |
61cb5a |
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
Packit |
61cb5a |
*/
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
/*
|
|
Packit |
61cb5a |
* Author: Jan Friesse <jfriesse@redhat.com>
|
|
Packit |
61cb5a |
*/
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
#ifndef _MSGSEND_H_
|
|
Packit |
61cb5a |
#define _MSGSEND_H_
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
#include <sys/types.h>
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
#include <sys/socket.h>
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
#include <net/if.h>
|
|
Packit |
61cb5a |
#include <netinet/in.h>
|
|
Packit |
61cb5a |
#include <arpa/inet.h>
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
#ifdef __cplusplus
|
|
Packit |
61cb5a |
extern "C" {
|
|
Packit |
61cb5a |
#endif
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
enum ms_answer_type {
|
|
Packit |
61cb5a |
MS_ANSWER_UCAST = 1,
|
|
Packit |
61cb5a |
MS_ANSWER_MCAST = 2,
|
|
Packit |
61cb5a |
MS_ANSWER_BOTH = 3,
|
|
Packit |
61cb5a |
};
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
extern int ms_answer(int ucast_socket, const struct sockaddr_storage *mcast_addr,
|
|
Packit |
61cb5a |
const char *orig_msg, size_t orig_msg_len, const struct msg_decoded *decoded,
|
|
Packit |
61cb5a |
const struct sockaddr_storage *to, uint8_t ttl, enum ms_answer_type answer_type);
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
extern int ms_init(int ucast_socket, const struct sockaddr_storage *remote_addr,
|
|
Packit |
61cb5a |
const struct sockaddr_storage *mcast_addr, const char *client_id, int req_si);
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
extern int ms_query(int ucast_socket, const struct sockaddr_storage *remote_addr,
|
|
Packit |
61cb5a |
const struct sockaddr_storage *mcast_addr, uint32_t seq_num, const char *client_id,
|
|
Packit |
61cb5a |
const char *ses_id, size_t ses_id_len);
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
extern int ms_response(int ucast_socket, const struct sockaddr_storage *mcast_addr,
|
|
Packit |
61cb5a |
const struct msg_decoded *decoded, const struct sockaddr_storage *to, int mcast_grp,
|
|
Packit |
61cb5a |
int mcast_prefix, const char *session_id, size_t session_id_len);
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
extern int ms_stop(int ucast_socket, const struct sockaddr_storage *mcast_addr,
|
|
Packit |
61cb5a |
const struct msg_decoded *decoded, const struct sockaddr_storage *to);
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
#ifdef __cplusplus
|
|
Packit |
61cb5a |
}
|
|
Packit |
61cb5a |
#endif
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
#endif /* _MSGSEND_H_ */
|