printf("not implemented\n");
break;
+ case ERR_BADREPLY:
+ printf("bad reply from switch\n");
+ break;
+
+ case ERR_UNKNOWN:
+ printf("unknown error\n");
+ break;
+
default:
printf("unknown status code (%i)\n", err);
}
ERR_INVARG = -6, /**< invalid argument */
ERR_TIMEOUT = -7, /**< timeout */
ERR_MEM = -8, /**< out of memory */
- ERR_NOTIMPL = -9 /**< not implemented */
+ ERR_NOTIMPL = -9, /**< not implemented */
+ ERR_BADREPLY = -10, /**< bad reply */
+ ERR_UNKNOWN = -11 /**< unknown error */
};
memset(ports, 0, 1 + sa->ports);
} else if (am->outport > 0 && at->size >= 1 + sa->ports) {
if (at->size < sizeof(struct attr_mirror) + sa->ports) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
goto end;
}
ports[0] = am->outport;
*t = VLAN_DISABLED;
if (attr->first == NULL) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
goto end;
}
at = attr->first->data;
filterAttributes(attr, ATTR_VLAN_PORT_CONF, ATTR_END);
if (attr->first == NULL) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
goto end;
}
avc = at->data;
if (at->size < sizeof(struct attr_vlan_conf) + sa->ports) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
goto end;
}
filterAttributes(conf_old, ATTR_VLAN_PORT_CONF, ATTR_END);
if (conf_old->first == NULL) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
goto end;
}
avc_old = at->data;
if (at->size < sizeof(struct attr_vlan_conf) + sa->ports) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
free(avc_new);
goto end;
}
filterAttributes(attr, ATTR_VLAN_DOT_CONF, ATTR_END);
if (attr->first == NULL) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
goto end;
}
avc = at->data;
if (at->size < sizeof(struct attr_vlan_conf) + sa->ports) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
goto end;
}
filterAttributes(attr, ATTR_VLAN_DOT_CONF, ATTR_END);
if (attr->first == NULL) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
goto end;
}
avc = at->data;
if (at->size < sizeof(struct attr_vlan_conf) + sa->ports) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
goto end;
}
/* check if the switch is in 802.1Q mode */
if (attr->first == NULL) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
goto end;
} else {
at = attr->first->data;
if (at->size < sizeof(struct attr_vlan_conf) + sa->ports) {
- ret = ERR_INVARG;
+ ret = ERR_BADREPLY;
goto end;
}
}