X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpackets.c;h=e05e3ebca5552de331a9ab7ebf55e31c92894536;hb=84095d268f41efd2754fb920b9e93b665f7b64ba;hp=d2229cd215d7a29a86d51041e9624562722a4030;hpb=eda1f38d41be1b604229343fe14d7122eaedd4d5;p=openvswitch diff --git a/lib/packets.c b/lib/packets.c index d2229cd2..e05e3ebc 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -289,46 +289,3 @@ snap_compose(struct ofpbuf *b, const uint8_t eth_dst[ETH_ADDR_LEN], return payload; } - -/* Populates 'pdu' with a LACP PDU comprised of 'actor' and 'partner'. */ -void -compose_lacp_pdu(const struct lacp_info *actor, - const struct lacp_info *partner, struct lacp_pdu *pdu) -{ - memset(pdu, 0, sizeof *pdu); - - pdu->subtype = 1; - pdu->version = 1; - - pdu->actor_type = 1; - pdu->actor_len = 20; - pdu->actor = *actor; - - pdu->partner_type = 2; - pdu->partner_len = 20; - pdu->partner = *partner; - - pdu->collector_type = 3; - pdu->collector_len = 16; - pdu->collector_delay = htons(0); -} - -/* Parses 'b' which represents a packet containing a LACP PDU. This function - * returns NULL if 'b' is malformed, or does not represent a LACP PDU format - * supported by OVS. Otherwise, it returns a pointer to the lacp_pdu contained - * within 'b'. */ -const struct lacp_pdu * -parse_lacp_packet(const struct ofpbuf *b) -{ - const struct lacp_pdu *pdu; - - pdu = ofpbuf_at(b, (uint8_t *)b->l3 - (uint8_t *)b->data, LACP_PDU_LEN); - - if (pdu && pdu->subtype == 1 - && pdu->actor_type == 1 && pdu->actor_len == 20 - && pdu->partner_type == 2 && pdu->partner_len == 20) { - return pdu; - } else { - return NULL; - } -}