Blame unicast_client.h

Packit Service d8d8ac
/**
Packit Service d8d8ac
 * @file unicast_client.h
Packit Service d8d8ac
 * @brief Unicast client implementation
Packit Service d8d8ac
 * @note Copyright (C) 2018 Richard Cochran <richardcochran@gmail.com>
Packit Service d8d8ac
 *
Packit Service d8d8ac
 * This program is free software; you can redistribute it and/or modify
Packit Service d8d8ac
 * it under the terms of the GNU General Public License as published by
Packit Service d8d8ac
 * the Free Software Foundation; either version 2 of the License, or
Packit Service d8d8ac
 * (at your option) any later version.
Packit Service d8d8ac
 *
Packit Service d8d8ac
 * This program is distributed in the hope that it will be useful,
Packit Service d8d8ac
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service d8d8ac
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service d8d8ac
 * GNU General Public License for more details.
Packit Service d8d8ac
 *
Packit Service d8d8ac
 * You should have received a copy of the GNU General Public License along
Packit Service d8d8ac
 * with this program; if not, write to the Free Software Foundation, Inc.,
Packit Service d8d8ac
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA.
Packit Service d8d8ac
 */
Packit Service d8d8ac
#ifndef HAVE_UNICAST_CLIENT_H
Packit Service d8d8ac
#define HAVE_UNICAST_CLIENT_H
Packit Service d8d8ac
Packit Service d8d8ac
/**
Packit Service d8d8ac
 * Handles a CANCEL_UNICAST_TRANSMISSION TLV from the grantor.
Packit Service d8d8ac
 * @param p      The port on which the signaling message was received.
Packit Service d8d8ac
 * @param m      The signaling message containing the cancellation.
Packit Service d8d8ac
 * @param extra  The TLV containing the cancellation.
Packit Service d8d8ac
 * @return       Zero on success, or non-zero
Packit Service d8d8ac
 *               if transmission of the ACK message failed.
Packit Service d8d8ac
 */
Packit Service d8d8ac
int unicast_client_cancel(struct port *p, struct ptp_message *m,
Packit Service d8d8ac
			  struct tlv_extra *extra);
Packit Service d8d8ac
Packit Service d8d8ac
/**
Packit Service d8d8ac
 * Finds and initializes the unicast master table configured for this
Packit Service d8d8ac
 * port, if any.
Packit Service d8d8ac
 * @param port   The port in question.
Packit Service d8d8ac
 * @return       Zero on success, non-zero otherwise.
Packit Service d8d8ac
 */
Packit Service d8d8ac
int unicast_client_claim_table(struct port *port);
Packit Service d8d8ac
Packit Service d8d8ac
/**
Packit Service d8d8ac
 * Tests whether a unicast master table is associated with a given port.
Packit Service d8d8ac
 * @param p      The port in question.
Packit Service d8d8ac
 * @return       One (1) if a unicast master table is configured on the port,
Packit Service d8d8ac
 *               or zero otherwise.
Packit Service d8d8ac
 */
Packit Service d8d8ac
int unicast_client_enabled(struct port *p);
Packit Service d8d8ac
Packit Service d8d8ac
/**
Packit Service d8d8ac
 * Handles a GRANT_UNICAST_TRANSMISSION TLV from the grantor.
Packit Service d8d8ac
 * @param p      The port on which the signaling message was received.
Packit Service d8d8ac
 * @param m      The signaling message containing the grant.
Packit Service d8d8ac
 * @param extra  The TLV containing the grant.
Packit Service d8d8ac
 */
Packit Service d8d8ac
void unicast_client_grant(struct port *p, struct ptp_message *m,
Packit Service d8d8ac
			  struct tlv_extra *extra);
Packit Service d8d8ac
Packit Service d8d8ac
/**
Packit Service d8d8ac
 * Programs the unicast request timer.
Packit Service d8d8ac
 * @param p      The port in question.
Packit Service d8d8ac
 * @return       Zero on success, non-zero otherwise.
Packit Service d8d8ac
 */
Packit Service d8d8ac
int unicast_client_set_tmo(struct port *p);
Packit Service d8d8ac
Packit Service d8d8ac
/**
Packit Service d8d8ac
 * Notifies the unicast client code that the port state has changed.
Packit Service d8d8ac
 * @param p      The port in question.
Packit Service d8d8ac
 */
Packit Service d8d8ac
void unicast_client_state_changed(struct port *p);
Packit Service d8d8ac
Packit Service d8d8ac
/**
Packit Service d8d8ac
 * Handles the unicast request timer, sending requests as needed.
Packit Service d8d8ac
 * @param p      The port in question.
Packit Service d8d8ac
 * @return       Zero on success, non-zero otherwise.
Packit Service d8d8ac
 */
Packit Service d8d8ac
int unicast_client_timer(struct port *p);
Packit Service d8d8ac
Packit Service d8d8ac
#endif