int error;
bool first;
- file = pcap_open(argv[1], "rb");
+ file = ovs_pcap_open(argv[1], "rb");
if (!file) {
ovs_fatal(errno, "%s: open failed", argv[1]);
}
long long int when;
struct flow flow;
- error = pcap_read(file, &packet, &when);
+ error = ovs_pcap_read(file, &packet, &when);
if (error) {
break;
}
struct cls_cursor cursor;
struct fte *fte, *next;
- ovs_rwlock_wrlock(&cls->rwlock);
+ fat_rwlock_wrlock(&cls->rwlock);
cls_cursor_init(&cursor, cls, NULL);
CLS_CURSOR_FOR_EACH_SAFE (fte, next, rule, &cursor) {
classifier_remove(cls, &fte->rule);
fte_free(fte);
}
- ovs_rwlock_unlock(&cls->rwlock);
+ fat_rwlock_unlock(&cls->rwlock);
classifier_destroy(cls);
}
cls_rule_init(&fte->rule, match, priority);
fte->versions[index] = version;
- ovs_rwlock_wrlock(&cls->rwlock);
+ fat_rwlock_wrlock(&cls->rwlock);
old = fte_from_cls_rule(classifier_replace(cls, &fte->rule));
- ovs_rwlock_unlock(&cls->rwlock);
+ fat_rwlock_unlock(&cls->rwlock);
if (old) {
fte_version_free(old->versions[index]);
fte->versions[!index] = old->versions[!index];
list_init(&requests);
/* Delete flows that exist on the switch but not in the file. */
- ovs_rwlock_rdlock(&cls.rwlock);
+ fat_rwlock_rdlock(&cls.rwlock);
cls_cursor_init(&cursor, &cls, NULL);
CLS_CURSOR_FOR_EACH (fte, rule, &cursor) {
struct fte_version *file_ver = fte->versions[FILE_IDX];
fte_make_flow_mod(fte, FILE_IDX, OFPFC_ADD, protocol, &requests);
}
}
- ovs_rwlock_unlock(&cls.rwlock);
+ fat_rwlock_unlock(&cls.rwlock);
transact_multiple_noreply(vconn, &requests);
vconn_close(vconn);
ds_init(&a_s);
ds_init(&b_s);
- ovs_rwlock_rdlock(&cls.rwlock);
+ fat_rwlock_rdlock(&cls.rwlock);
cls_cursor_init(&cursor, &cls, NULL);
CLS_CURSOR_FOR_EACH (fte, rule, &cursor) {
struct fte_version *a = fte->versions[0];
}
}
}
- ovs_rwlock_unlock(&cls.rwlock);
+ fat_rwlock_unlock(&cls.rwlock);
ds_destroy(&a_s);
ds_destroy(&b_s);
{
FILE *pcap;
- pcap = pcap_open(argv[1], "rb");
+ pcap = ovs_pcap_open(argv[1], "rb");
if (!pcap) {
ovs_fatal(errno, "%s: open failed", argv[1]);
}
struct flow flow;
int error;
- error = pcap_read(pcap, &packet, NULL);
+ error = ovs_pcap_read(pcap, &packet, NULL);
if (error == EOF) {
break;
} else if (error) {