- self.papi.ipsec_sad_add_del_entry,
- {'sad_id': sad_id,
- 'spi': spi,
- 'tunnel_src_address': tunnel_src_address,
- 'tunnel_dst_address': tunnel_dst_address,
- 'protocol': protocol,
- 'integrity_algorithm': integrity_algorithm,
- 'integrity_key_length': len(integrity_key),
- 'integrity_key': integrity_key,
- 'crypto_algorithm': crypto_algorithm,
- 'crypto_key_length': len(crypto_key) if crypto_key is not None
- else 0,
- 'crypto_key': crypto_key,
- 'is_add': is_add,
- 'is_tunnel': is_tunnel,
- 'is_tunnel_ipv6': is_tunnel_ipv6,
- 'udp_encap': udp_encap,
- 'use_extended_sequence_number': use_extended_sequence_number,
- 'use_anti_replay': use_anti_replay})
+ self.papi.ipsec_sad_entry_add_del,
+ {
+ 'is_add': is_add,
+ 'entry':
+ {
+ 'sad_id': sad_id,
+ 'spi': spi,
+ 'tunnel_src': tunnel_src_address,
+ 'tunnel_dst': tunnel_dst_address,
+ 'protocol': protocol,
+ 'integrity_algorithm': integrity_algorithm,
+ 'integrity_key': {
+ 'length': len(integrity_key),
+ 'data': integrity_key,
+ },
+ 'crypto_algorithm': crypto_algorithm,
+ 'crypto_key': {
+ 'length': len(crypto_key),
+ 'data': crypto_key,
+ },
+ 'flags': flags,
+ }
+ })
+
+ def ipsec_sa_dump(self, sa_id=None):
+ return self.api(self.papi.ipsec_sa_dump,
+ {'sa_id': sa_id if sa_id else 0xffffffff})