diff options
author | Sander Vrijders <[email protected]> | 2017-09-20 13:56:17 +0200 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2017-09-20 14:16:34 +0200 |
commit | 2c7e3030edb84abae14042f7a1a22b44255324be (patch) | |
tree | db0bb53b7627066ba44cc1f9f429e11d1fa7bf65 /src/ipcpd/normal/pff.h | |
parent | f9fd352f38c3c3d9e7824b8cf84b8f86e2a6d392 (diff) | |
download | ouroboros-2c7e3030edb84abae14042f7a1a22b44255324be.tar.gz ouroboros-2c7e3030edb84abae14042f7a1a22b44255324be.zip |
ipcpd: normal: Make PFF policy-based
This turns the PDU Forwarding Function of the IPCP into a policy. For
now only the simple PFF policy is available.
Diffstat (limited to 'src/ipcpd/normal/pff.h')
-rw-r--r-- | src/ipcpd/normal/pff.h | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/src/ipcpd/normal/pff.h b/src/ipcpd/normal/pff.h index 0a33d884..f44cd0e9 100644 --- a/src/ipcpd/normal/pff.h +++ b/src/ipcpd/normal/pff.h @@ -23,36 +23,41 @@ #ifndef OUROBOROS_IPCPD_NORMAL_PFF_H #define OUROBOROS_IPCPD_NORMAL_PFF_H +#include <ouroboros/ipcp.h> + #include <stdint.h> +#include <stdlib.h> +#include <stdbool.h> -/* - * PFF will take a type in the future, - * to allow different policies. - * Only 1 fd per next hop for now. - */ -struct pff * pff_create(void); +struct pff * pff_create(enum pol_pff pol); -void pff_destroy(struct pff * instance); +void pff_destroy(struct pff * pff); -void pff_lock(struct pff * instance); +void pff_lock(struct pff * pff); -void pff_unlock(struct pff * instance); +void pff_unlock(struct pff * pff); -int pff_add(struct pff * instance, +int pff_add(struct pff * pff, uint64_t addr, - int fd); + int * fd, + size_t len); -int pff_update(struct pff * instance, +int pff_update(struct pff * pff, uint64_t addr, - int fd); + int * fd, + size_t len); -int pff_remove(struct pff * instance, - uint64_t addr); +int pff_del(struct pff * pff, + uint64_t addr); -void pff_flush(struct pff * instance); +void pff_flush(struct pff * pff); /* Returns fd towards next hop */ -int pff_nhop(struct pff * instance, +int pff_nhop(struct pff * pff, uint64_t addr); +int pff_flow_state_change(struct pff * pff, + int fd, + bool up); + #endif /* OUROBOROS_IPCPD_NORMAL_PFF_H */ |