avb: more work

Implement generic MRP parsing.
Implement more MRP messages.
Implement MRP timeouts.
Implement MRP join/leave.
Prepare for generating and sending MRP packets.
This commit is contained in:
Wim Taymans 2022-03-23 19:57:25 +01:00
parent 0efc02cea6
commit f64f8cdd4d
11 changed files with 707 additions and 137 deletions

View file

@ -31,12 +31,37 @@
#define AVB_MMRP_ETH 0x88f6
#define AVB_MMRP_MAC { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x20 }
#define AVBTP_MMRP_ATTRIBUTE_TYPE_SERVICE_REQUIREMENT 1
#define AVBTP_MMRP_ATTRIBUTE_TYPE_MAC 2
#define AVBTP_MMRP_ATTRIBUTE_TYPE_VALID(t) ((t)>=1 && (t)<=2)
struct avbtp_packet_mmrp_msg {
uint8_t attribute_type;
uint8_t attribute_length;
uint8_t attribute_list[0];
} __attribute__ ((__packed__));
int avbtp_mmrp_register(struct server *server);
struct avbtp_packet_mmrp_service_requirement {
unsigned char addr[6];
} __attribute__ ((__packed__));
struct avbtp_packet_mmrp_mac {
unsigned char addr[6];
} __attribute__ ((__packed__));
struct avbtp_mmrp;
struct avbtp_mmrp_attribute {
uint8_t type;
union {
struct avbtp_packet_mmrp_service_requirement service_requirement;
struct avbtp_packet_mmrp_mac mac;
} attr;
};
struct avbtp_mmrp_attribute *avbtp_mmrp_attribute_new(struct avbtp_mmrp *mmrp,
uint8_t type);
struct avbtp_mmrp *avbtp_mmrp_register(struct server *server);
#endif /* AVBTP_MMRP_H */