Blame transport_private.h

Packit 9c3e7e
/**
Packit 9c3e7e
 * @file transport_private.h
Packit 9c3e7e
 * @brief Defines a private interface for the abstract transport layer.
Packit 9c3e7e
 * @note Copyright (C) 2012 Richard Cochran <richardcochran@gmail.com>
Packit 9c3e7e
 *
Packit 9c3e7e
 * This program is free software; you can redistribute it and/or modify
Packit 9c3e7e
 * it under the terms of the GNU General Public License as published by
Packit 9c3e7e
 * the Free Software Foundation; either version 2 of the License, or
Packit 9c3e7e
 * (at your option) any later version.
Packit 9c3e7e
 *
Packit 9c3e7e
 * This program is distributed in the hope that it will be useful,
Packit 9c3e7e
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 9c3e7e
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 9c3e7e
 * GNU General Public License for more details.
Packit 9c3e7e
 *
Packit 9c3e7e
 * You should have received a copy of the GNU General Public License along
Packit 9c3e7e
 * with this program; if not, write to the Free Software Foundation, Inc.,
Packit 9c3e7e
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Packit 9c3e7e
 */
Packit 9c3e7e
#ifndef HAVE_TRANSPORT_PRIVATE_H
Packit 9c3e7e
#define HAVE_TRANSPORT_PRIVATE_H
Packit 9c3e7e
Packit 9c3e7e
#include <time.h>
Packit 9c3e7e
Packit 9c3e7e
#include "address.h"
Packit 9c3e7e
#include "fd.h"
Packit 9c3e7e
#include "transport.h"
Packit 9c3e7e
Packit 9c3e7e
struct transport {
Packit 9c3e7e
	enum transport_type type;
Packit 9c3e7e
	struct config *cfg;
Packit 9c3e7e
Packit 9c3e7e
	int (*close)(struct transport *t, struct fdarray *fda);
Packit 9c3e7e
Packit 9c3e7e
	int (*open)(struct transport *t, struct interface *iface,
Packit 9c3e7e
		    struct fdarray *fda, enum timestamp_type tt);
Packit 9c3e7e
Packit 9c3e7e
	int (*recv)(struct transport *t, int fd, void *buf, int buflen,
Packit 9c3e7e
		    struct address *addr, struct hw_timestamp *hwts);
Packit 9c3e7e
Packit 9c3e7e
	int (*send)(struct transport *t, struct fdarray *fda,
Packit 9c3e7e
		    enum transport_event event, int peer, void *buf, int buflen,
Packit 9c3e7e
		    struct address *addr, struct hw_timestamp *hwts);
Packit 9c3e7e
Packit 9c3e7e
	void (*release)(struct transport *t);
Packit 9c3e7e
Packit 9c3e7e
	int (*physical_addr)(struct transport *t, uint8_t *addr);
Packit 9c3e7e
Packit 9c3e7e
	int (*protocol_addr)(struct transport *t, uint8_t *addr);
Packit 9c3e7e
};
Packit 9c3e7e
Packit 9c3e7e
#endif