port: Add a method for processing received signaling messages.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
e8e2be017a
commit
c2ab96fd40
|
@ -172,6 +172,7 @@ void process_follow_up(struct port *p, struct ptp_message *m);
|
|||
int process_pdelay_req(struct port *p, struct ptp_message *m);
|
||||
int process_pdelay_resp(struct port *p, struct ptp_message *m);
|
||||
void process_pdelay_resp_fup(struct port *p, struct ptp_message *m);
|
||||
int process_signaling(struct port *p, struct ptp_message *m);
|
||||
void process_sync(struct port *p, struct ptp_message *m);
|
||||
int source_pid_eq(struct ptp_message *m1, struct ptp_message *m2);
|
||||
void ts_add(tmv_t *ts, Integer64 correction);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA.
|
||||
*/
|
||||
#include "port_private.h"
|
||||
#include "unicast_client.h"
|
||||
|
||||
struct ptp_message *port_signaling_construct(struct port *p,
|
||||
struct address *address,
|
||||
|
@ -44,3 +45,40 @@ struct ptp_message *port_signaling_construct(struct port *p,
|
|||
|
||||
return msg;
|
||||
}
|
||||
|
||||
int process_signaling(struct port *p, struct ptp_message *m)
|
||||
{
|
||||
struct tlv_extra *extra;
|
||||
int err = 0;
|
||||
|
||||
switch (p->state) {
|
||||
case PS_INITIALIZING:
|
||||
case PS_FAULTY:
|
||||
case PS_DISABLED:
|
||||
return 0;
|
||||
case PS_LISTENING:
|
||||
case PS_PRE_MASTER:
|
||||
case PS_MASTER:
|
||||
case PS_GRAND_MASTER:
|
||||
case PS_PASSIVE:
|
||||
case PS_UNCALIBRATED:
|
||||
case PS_SLAVE:
|
||||
break;
|
||||
}
|
||||
|
||||
TAILQ_FOREACH(extra, &m->tlv_list, list) {
|
||||
switch (extra->tlv->type) {
|
||||
case TLV_REQUEST_UNICAST_TRANSMISSION:
|
||||
break;
|
||||
case TLV_GRANT_UNICAST_TRANSMISSION:
|
||||
unicast_client_grant(p, m, extra);
|
||||
break;
|
||||
case TLV_CANCEL_UNICAST_TRANSMISSION:
|
||||
err = unicast_client_cancel(p, m, extra);
|
||||
break;
|
||||
case TLV_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue