diff options
author | Sander Vrijders <[email protected]> | 2016-09-06 10:29:02 +0200 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2016-09-07 13:58:21 +0200 |
commit | 2cf4f88fc8b957c15ae93a2eb3e56ebdb07a0381 (patch) | |
tree | 1b3bd39aa4b84132559cc8032024f44a1e9c8015 /src/ipcpd/normal/shm_pci.h | |
parent | ee2235c62cf0c51f7188fdeb6ac283c1e2ea0335 (diff) | |
download | ouroboros-2cf4f88fc8b957c15ae93a2eb3e56ebdb07a0381.tar.gz ouroboros-2cf4f88fc8b957c15ae93a2eb3e56ebdb07a0381.zip |
ipcpd: normal: Add operations to get and set the PCI
This adds the operations needed in the normal IPCP to get and set the
Protocol Control Information. It allows to allocate or release space
in the current DU. The struct pci can be serialized into newly
allocate space. Vice versa, a struct pci can be deserialized given a
DU. It allows for decreasing the TTL in the DU and for calculating the
CRC32. The TTL and CRC32 can now be selected when creating a new DIF.
Diffstat (limited to 'src/ipcpd/normal/shm_pci.h')
-rw-r--r-- | src/ipcpd/normal/shm_pci.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/ipcpd/normal/shm_pci.h b/src/ipcpd/normal/shm_pci.h index cb8dd5dd..aa9770b4 100644 --- a/src/ipcpd/normal/shm_pci.h +++ b/src/ipcpd/normal/shm_pci.h @@ -24,20 +24,28 @@ #ifndef OUROBOROS_IPCP_SHM_PCI_H #define OUROBOROS_IPCP_SHM_PCI_H -#include <ouroboros/shm_du_map.h> +#include <ouroboros/shm_rdrbuff.h> #include <dt_const.h> -struct shm_pci; +struct pci { + uint64_t dst_addr; + uint64_t src_addr; + uint32_t dst_cep_id; + uint32_t src_cep_id; + uint32_t pdu_length; + uint64_t seqno; + uint8_t qos_id; + uint8_t ttl; +}; -typedef struct shm_pci shm_pci_t; +int shm_pci_ser(struct shm_du_buff * sdb, + struct pci * pci); -shm_pci_t * shm_pci_create(struct shm_du_buff * dub, - const struct ipcp_dtp_const * dtpc, - const struct ipcp_dup_const * dupc); -void shm_pci_destroy(shm_pci_t * pci); +struct pci * shm_pci_des(struct shm_du_buff * sdb); -int shm_pci_init(shm_pci_t * pci); -void shm_pci_release(shm_pci_t * pci); +int shm_pci_shrink(struct shm_du_buff * sdb); + +int shm_pci_dec_ttl(struct shm_du_buff * sdb); #endif /* OUROBOROS_IPCP_SHM_PCI_H */ |