int lldp_read_chassis_id(tlv_packet *tlv,
uint8_t *type,
- uint16_t *length,
- uint8_t **data) {
+ uint8_t **data,
+ uint16_t *length) {
uint8_t subtype;
int r;
int lldp_read_port_id(tlv_packet *tlv,
uint8_t *type,
- uint16_t *length,
- uint8_t **data) {
+ uint8_t **data,
+ uint16_t *length) {
uint8_t subtype;
char *s;
int r;
}
int lldp_read_system_name(tlv_packet *tlv,
- uint16_t *length,
- char **data) {
+ char **data,
+ uint16_t *length) {
char *s;
int r;
}
int lldp_read_system_description(tlv_packet *tlv,
- uint16_t *length,
- char **data) {
+ char **data,
+ uint16_t *length) {
char *s;
int r;
}
int lldp_read_port_description(tlv_packet *tlv,
- uint16_t *length,
- char **data) {
+ char **data,
+ uint16_t *length) {
char *s;
int r;
assert_return(c, -EINVAL);
assert_return(tlv, -EINVAL);
- r = lldp_read_port_id(tlv, &type, &length, &data);
+ r = lldp_read_port_id(tlv, &type, &data, &length);
if (r < 0)
return r;
assert_return(c, -EINVAL);
assert_return(tlv, -EINVAL);
- r = lldp_read_port_id(tlv, &type, &length, &data);
+ r = lldp_read_port_id(tlv, &type, &data, &length);
if (r < 0)
return r;
assert_return(neighbour_mib, -EINVAL);
assert_return(tlv, -EINVAL);
- r = lldp_read_chassis_id(tlv, &subtype, &length, &data);
+ r = lldp_read_chassis_id(tlv, &subtype, &data, &length);
if (r < 0)
goto drop;
assert(tlv);
- r = lldp_read_port_id(tlv, &type, &length, &data);
+ r = lldp_read_port_id(tlv, &type, &data, &length);
if (r < 0)
return r;
assert(tlv);
- r = lldp_read_chassis_id(tlv, &type, &length, &data);
+ r = lldp_read_chassis_id(tlv, &type, &data, &length);
if (r < 0)
return r;
int lldp_mib_add_objects(Prioq *by_expiry, Hashmap *neighbour_mib, tlv_packet *tlv);
int lldp_mib_remove_objects(lldp_chassis *c, tlv_packet *tlv);
-int lldp_read_chassis_id(tlv_packet *tlv, uint8_t *type, uint16_t *length, uint8_t **data);
-int lldp_read_port_id(tlv_packet *tlv, uint8_t *type, uint16_t *length, uint8_t **data);
+int lldp_read_chassis_id(tlv_packet *tlv, uint8_t *type, uint8_t **data, uint16_t *length);
+int lldp_read_port_id(tlv_packet *tlv, uint8_t *type, uint8_t **data, uint16_t *length);
int lldp_read_ttl(tlv_packet *tlv, uint16_t *ttl);
-int lldp_read_system_name(tlv_packet *tlv, uint16_t *length, char **data);
-int lldp_read_system_description(tlv_packet *tlv, uint16_t *length, char **data);
+int lldp_read_system_name(tlv_packet *tlv, char **data, uint16_t *length);
+int lldp_read_system_description(tlv_packet *tlv, char **data, uint16_t *length);
int lldp_read_system_capability(tlv_packet *tlv, uint16_t *data);
-int lldp_read_port_description(tlv_packet *tlv, uint16_t *length, char **data);
+int lldp_read_port_description(tlv_packet *tlv, char **data, uint16_t *length);
int lldp_handle_packet(tlv_packet *m, uint16_t length);
#define log_lldp(fmt, ...) log_internal(LOG_DEBUG, 0, __FILE__, __LINE__, __func__, "LLDP: " fmt, ##__VA_ARGS__)
_cleanup_free_ char *s = NULL;
char *k, *t;
- r = lldp_read_chassis_id(p->packet, &type, &length, &mac);
+ r = lldp_read_chassis_id(p->packet, &type, &mac, &length);
if (r < 0)
continue;
goto fail;
}
- r = lldp_read_port_id(p->packet, &type, &length, &port_id);
+ r = lldp_read_port_id(p->packet, &type, &port_id, &length);
if (r < 0)
continue;
free(s);
s = k;
- r = lldp_read_system_name(p->packet, &length, &k);
+ r = lldp_read_system_name(p->packet, &k, &length);
if (r < 0)
k = strappend(s, "'_NAME=N/A' ");
else {