Blame unicast_client.h

Packit 9c3e7e
/**
Packit 9c3e7e
 * @file unicast_client.h
Packit 9c3e7e
 * @brief Unicast client implementation
Packit 9c3e7e
 * @note Copyright (C) 2018 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-1335 USA.
Packit 9c3e7e
 */
Packit 9c3e7e
#ifndef HAVE_UNICAST_CLIENT_H
Packit 9c3e7e
#define HAVE_UNICAST_CLIENT_H
Packit 9c3e7e
Packit 9c3e7e
/**
Packit 9c3e7e
 * Handles a CANCEL_UNICAST_TRANSMISSION TLV from the grantor.
Packit 9c3e7e
 * @param p      The port on which the signaling message was received.
Packit 9c3e7e
 * @param m      The signaling message containing the cancellation.
Packit 9c3e7e
 * @param extra  The TLV containing the cancellation.
Packit 9c3e7e
 * @return       Zero on success, or non-zero
Packit 9c3e7e
 *               if transmission of the ACK message failed.
Packit 9c3e7e
 */
Packit 9c3e7e
int unicast_client_cancel(struct port *p, struct ptp_message *m,
Packit 9c3e7e
			  struct tlv_extra *extra);
Packit 9c3e7e
Packit 9c3e7e
/**
Packit 9c3e7e
 * Finds and initializes the unicast master table configured for this
Packit 9c3e7e
 * port, if any.
Packit 9c3e7e
 * @param port   The port in question.
Packit 9c3e7e
 * @return       Zero on success, non-zero otherwise.
Packit 9c3e7e
 */
Packit 9c3e7e
int unicast_client_claim_table(struct port *port);
Packit 9c3e7e
Packit 9c3e7e
/**
Packit 9c3e7e
 * Tests whether a unicast master table is associated with a given port.
Packit 9c3e7e
 * @param p      The port in question.
Packit 9c3e7e
 * @return       One (1) if a unicast master table is configured on the port,
Packit 9c3e7e
 *               or zero otherwise.
Packit 9c3e7e
 */
Packit 9c3e7e
int unicast_client_enabled(struct port *p);
Packit 9c3e7e
Packit 9c3e7e
/**
Packit 9c3e7e
 * Handles a GRANT_UNICAST_TRANSMISSION TLV from the grantor.
Packit 9c3e7e
 * @param p      The port on which the signaling message was received.
Packit 9c3e7e
 * @param m      The signaling message containing the grant.
Packit 9c3e7e
 * @param extra  The TLV containing the grant.
Packit 9c3e7e
 */
Packit 9c3e7e
void unicast_client_grant(struct port *p, struct ptp_message *m,
Packit 9c3e7e
			  struct tlv_extra *extra);
Packit 9c3e7e
Packit 9c3e7e
/**
Packit 9c3e7e
 * Programs the unicast request timer.
Packit 9c3e7e
 * @param p      The port in question.
Packit 9c3e7e
 * @return       Zero on success, non-zero otherwise.
Packit 9c3e7e
 */
Packit 9c3e7e
int unicast_client_set_tmo(struct port *p);
Packit 9c3e7e
Packit 9c3e7e
/**
Packit 9c3e7e
 * Notifies the unicast client code that the port state has changed.
Packit 9c3e7e
 * @param p      The port in question.
Packit 9c3e7e
 */
Packit 9c3e7e
void unicast_client_state_changed(struct port *p);
Packit 9c3e7e
Packit 9c3e7e
/**
Packit 9c3e7e
 * Handles the unicast request timer, sending requests as needed.
Packit 9c3e7e
 * @param p      The port in question.
Packit 9c3e7e
 * @return       Zero on success, non-zero otherwise.
Packit 9c3e7e
 */
Packit 9c3e7e
int unicast_client_timer(struct port *p);
Packit 9c3e7e
Packit 9c3e7e
#endif