raw: implement getting physical and protocol addrs

master
Geoff Salmon 2013-01-08 19:21:25 -05:00 committed by Richard Cochran
parent e010937783
commit d6779889cc
1 changed files with 16 additions and 0 deletions

16
raw.c
View File

@ -295,6 +295,20 @@ static void raw_release(struct transport *t)
free(raw);
}
static int raw_physical_addr(struct transport *t, uint8_t *addr)
{
struct raw *raw = container_of(t, struct raw, t);
memcpy(addr, raw->ptp_addr.src, MAC_LEN);
return MAC_LEN;
}
static int raw_protocol_addr(struct transport *t, uint8_t *addr)
{
struct raw *raw = container_of(t, struct raw, t);
memcpy(addr, raw->ptp_addr.src, MAC_LEN);
return MAC_LEN;
}
struct transport *raw_transport_create(void)
{
struct raw *raw;
@ -306,5 +320,7 @@ struct transport *raw_transport_create(void)
raw->t.recv = raw_recv;
raw->t.send = raw_send;
raw->t.release = raw_release;
raw->t.physical_addr = raw_physical_addr;
raw->t.protocol_addr = raw_protocol_addr;
return &raw->t;
}