int pfq_bind(pfq_t *q, const char *dev, int queue) { int gid = q->gid; if (gid < 0) { return Q_ERROR(q, "PFQ: default group undefined"); } return pfq_bind_group(q, gid, dev, queue); }
void test_bind_device() { pfq_t * q = pfq_open(64, 1024, 1024); assert(q); assert(pfq_bind(q, "unknown", Q_ANY_QUEUE) == -1); assert(pfq_bind(q, "eth0", Q_ANY_QUEUE) == 0); assert(pfq_bind_group(q, 11, "eth0", Q_ANY_QUEUE) == -1); pfq_close(q); }