

CREATE TABLE identities (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  type INTEGER NOT NULL,
  data BLOB NOT NULL,
  UNIQUE (type, data)
);


CREATE TABLE child_configs (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  name TEXT NOT NULL,
  lifetime INTEGER NOT NULL DEFAULT '1500',
  rekeytime INTEGER NOT NULL DEFAULT '1200',
  jitter INTEGER NOT NULL DEFAULT '60',
  updown TEXT DEFAULT NULL,
  hostaccess INTEGER NOT NULL DEFAULT '0',
  mode INTEGER NOT NULL DEFAULT '2',
  start_action INTEGER NOT NULL DEFAULT '0',
  dpd_action INTEGER NOT NULL DEFAULT '0',
  close_action INTEGER NOT NULL DEFAULT '0',
  ipcomp INTEGER NOT NULL DEFAULT '0',
  reqid INTEGER NOT NULL DEFAULT '0'
);
DROP INDEX IF EXISTS child_configs_name;
CREATE INDEX child_configs_name ON child_configs (
  name
);


CREATE TABLE child_config_traffic_selector (
  child_cfg INTEGER NOT NULL,
  traffic_selector INTEGER NOT NULL,
  kind INTEGER NOT NULL
);
DROP INDEX IF EXISTS child_config_traffic_selector_all;
CREATE INDEX child_config_traffic_selector_all ON child_config_traffic_selector (
  child_cfg, traffic_selector
);

CREATE TABLE proposals (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  proposal TEXT NOT NULL
);


CREATE TABLE child_config_proposal (
  child_cfg INTEGER NOT NULL,
  prio INTEGER NOT NULL,
  prop INTEGER NOT NULL
);


CREATE TABLE ike_configs (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  certreq INTEGER NOT NULL DEFAULT '1',
  force_encap INTEGER NOT NULL DEFAULT '0',
  local TEXT NOT NULL,
  remote TEXT NOT NULL
);


CREATE TABLE ike_config_proposal (
  ike_cfg INTEGER NOT NULL,
  prio INTEGER NOT NULL,
  prop INTEGER NOT NULL
);


CREATE TABLE peer_configs (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  name TEXT NOT NULL,
  ike_version INTEGER NOT NULL DEFAULT '2',
  ike_cfg INTEGER NOT NULL,
  local_id TEXT NOT NULL,
  remote_id TEXT NOT NULL,
  cert_policy INTEGER NOT NULL DEFAULT '1',
  uniqueid INTEGER NOT NULL DEFAULT '0',
  auth_method INTEGER NOT NULL DEFAULT '1',
  eap_type INTEGER NOT NULL DEFAULT '0',
  eap_vendor INTEGER NOT NULL DEFAULT '0',
  keyingtries INTEGER NOT NULL DEFAULT '3',
  rekeytime INTEGER NOT NULL DEFAULT '7200',
  reauthtime INTEGER NOT NULL DEFAULT '0',
  jitter INTEGER NOT NULL DEFAULT '180',
  overtime INTEGER NOT NULL DEFAULT '300',
  mobike INTEGER NOT NULL DEFAULT '1',
  dpd_delay INTEGER NOT NULL DEFAULT '120',
  virtual TEXT DEFAULT NULL,
  pool TEXT DEFAULT NULL,
  mediation INTEGER NOT NULL DEFAULT '0',
  mediated_by INTEGER NOT NULL DEFAULT '0',
  peer_id INTEGER NOT NULL DEFAULT '0'
);
DROP INDEX IF EXISTS peer_configs_name;
CREATE INDEX peer_configs_name ON peer_configs (
  name
);


CREATE TABLE peer_config_child_config (
  peer_cfg INTEGER NOT NULL,
  child_cfg INTEGER NOT NULL,
  PRIMARY KEY (peer_cfg, child_cfg)
);


CREATE TABLE traffic_selectors (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  type INTEGER NOT NULL DEFAULT '7',
  protocol INTEGER NOT NULL DEFAULT '0',
  start_addr BLOB DEFAULT NULL,
  end_addr BLOB DEFAULT NULL,
  start_port INTEGER NOT NULL DEFAULT '0',
  end_port INTEGER NOT NULL DEFAULT '65535'
);


CREATE TABLE certificates (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  type INTEGER NOT NULL,
  keytype INTEGER NOT NULL,
  data BLOB NOT NULL
);


CREATE TABLE certificate_identity (
  certificate INTEGER NOT NULL,
  identity INTEGER NOT NULL,
  PRIMARY KEY (certificate, identity)
);


CREATE TABLE private_keys (
  id INTEGER NOT NULL  PRIMARY KEY AUTOINCREMENT,
  type INTEGER NOT NULL,
  data BLOB NOT NULL
);


CREATE TABLE private_key_identity (
  private_key INTEGER NOT NULL,
  identity INTEGER NOT NULL,
  PRIMARY KEY (private_key, identity)
);


CREATE TABLE shared_secrets (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  type INTEGER NOT NULL,
  data BLOB NOT NULL
);


CREATE TABLE shared_secret_identity (
  shared_secret INTEGER NOT NULL,
  identity INTEGER NOT NULL,
  PRIMARY KEY (shared_secret, identity)
);


CREATE TABLE certificate_authorities (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  certificate INTEGER NOT NULL
);


CREATE TABLE certificate_distribution_points (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  ca INTEGER NOT NULL,
  type INTEGER NOT NULL,
  uri TEXT NOT NULL
);


CREATE TABLE pools (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  name TEXT NOT NULL UNIQUE,
  start BLOB NOT NULL,
  end BLOB NOT NULL,
  timeout INTEGER NOT NULL
);

CREATE TABLE addresses (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  pool INTEGER NOT NULL,
  address BLOB NOT NULL,
  identity INTEGER NOT NULL DEFAULT 0,
  acquired INTEGER NOT NULL DEFAULT 0,
  released INTEGER NOT NULL DEFAULT 1
);
DROP INDEX IF EXISTS addresses_pool;
CREATE INDEX addresses_pool ON addresses (
  pool
);
DROP INDEX IF EXISTS addresses_address;
CREATE INDEX addresses_address ON addresses (
  address
);
DROP INDEX IF EXISTS addresses_identity;
CREATE INDEX addresses_identity ON addresses (
  identity
);

CREATE TABLE leases (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  address INTEGER NOT NULL,
  identity INTEGER NOT NULL,
  acquired INTEGER NOT NULL,
  released INTEGER NOT NULL
);

CREATE TABLE attribute_pools (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  name TEXT NOT NULL
);

CREATE TABLE attributes (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  identity INTEGER NOT NULL DEFAULT 0,
  pool INTEGER NOT NULL DEFAULT 0,
  type INTEGER NOT NULL,
  value BLOB NOT NULL
);
DROP INDEX IF EXISTS attributes_identity;
CREATE INDEX attributes_identity ON attributes (
  identity
);
DROP INDEX IF EXISTS attributes_pool;
CREATE INDEX attributes_pool ON attributes (
  pool
);

CREATE TABLE ike_sas (
  local_spi BLOB NOT NULL PRIMARY KEY,
  remote_spi BLOB NOT NULL,
  id INTEGER NOT NULL,
  initiator INTEGER NOT NULL,
  local_id_type INTEGER NOT NULL,
  local_id_data BLOB DEFAULT NULL,
  remote_id_type INTEGER NOT NULL,
  remote_id_data BLOB DEFAULT NULL,
  host_family INTEGER NOT NULL,
  local_host_data BLOB NOT NULL,
  remote_host_data BLOB NOT NULL,
  created INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE logs (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  local_spi BLOB NOT NULL,
  signal INTEGER NOT NULL,
  level INTEGER NOT NULL,
  msg TEXT NOT NULL,
  time INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP
);

/* Identities */

INSERT INTO identities (
  type, data
) VALUES ( /* C=CH, O=strongSwan Project, CN=strongSwan Root CA */
  9, X'3047310b3009060355040613024348311b3019060355040a13127374726f6e675377616e2050726f6a656374311b3019060355040313127374726f6e675377616e20526f6f74204341'
);

INSERT INTO identities (
  type, data
) VALUES ( /* subjkey of 'C=CH, O=strongSwan Project, CN=strongSwan Root CA' */
  11, X'288a0bd0d28511dae59ffa160ab021d708922d67'
);

INSERT INTO identities (
  type, data
) VALUES ( /* keyid of 'C=CH, O=strongSwan Project, CN=strongSwan Root CA' */
  11, X'91f8e4475f0bc75a388624bcf0a56fe6a45f0c2a'
);

INSERT INTO identities (
  type, data
) VALUES ( /* venus.strongswan.org */
  2, X'76656e75732e7374726f6e677377616e2e6f7267'
 );

INSERT INTO identities (
  type, data
) VALUES ( /* sun.strongswan.org */
  2, X'73756e2e7374726f6e677377616e2e6f7267'
 );

INSERT INTO identities (
  type, data
) VALUES ( /* subjkey of 'C=CH, O=strongSwan Project, CN=venus.strongswan.org' */
  11, X'5a9e7e2ee183eca509d04016cbc55d41d906fa70'
 );

INSERT INTO identities (
  type, data
) VALUES ( /* %any */
  0, '%any'
);

/* Certificates */

INSERT INTO certificates (
   type, keytype, data
) VALUES ( /* C=CH, O=strongSwan Project, CN=strongSwan Root CA */
  1, 1, X'30820455308202bda00302010202083e9346d3b12d6782300d06092a864886f70d01010b05003047310b3009060355040613024348311b3019060355040a13127374726f6e675377616e2050726f6a656374311b3019060355040313127374726f6e675377616e20526f6f74204341301e170d3235313130363030313332365a170d3335313130373030313332365a3047310b3009060355040613024348311b3019060355040a13127374726f6e675377616e2050726f6a656374311b3019060355040313127374726f6e675377616e20526f6f74204341308201a2300d06092a864886f70d01010105000382018f003082018a0282018100997a7e790296b1dfe697090d480043ab51d6deb0a4415223a2dcdd7cfee9f2aba271ed293f12691ba6fd3bf3b477e7dfa4e57778dca316075725056c0a35cc273aed5411b04663998f04eccb8066082d615f15e0588469a595acadfa8fcfeaa5bacc09192c4a4c45792672e291a4da45708561ac6b8c5ed5aaf5a25761c6357d18875b0391cbd4c6265351c814bea4fcc9fbd3e606794f02d89326162ab86e9194f30840e920c192c2d97129e8e93e08543ba8c4cb2c057b9e64215b5ec93a5cd8ef040b3e4df77e617cb4c79afa94385e2c90de44910d4fa112db3deef80589851ba090405c70a061ac752391963eb68c837bfbb8a5ead5f30b54c797591c4ab42904c4930994452b9b776f983c7e3debe5b1ce5b029e5daab6e720e7bc54d4dac75a702cbd809e695b6d9916cac2279a5c04ba6eaab70646274efb99600604604b836542140b43020ad6b2c33c2f8326fd4a34391e2011092d321e84820425bb6562428138ad630cf12ce66de2d85b33151ec43e4504c722f1384e80accbb10203010001a345304330120603551d130101ff040830060101ff020101300e0603551d0f0101ff040403020106301d0603551d0e04160414288a0bd0d28511dae59ffa160ab021d708922d67300d06092a864886f70d01010b050003820181007ccad9c8210802532b184e5fbd23a15cf6830ca783c5cefd1485ea7dd9e5a339074c6e089193d41d4402f31f260be503ab54aa5fc710261ca72455c3aec5f66224ccac23c57b901aaf8df4d878151082765ae6ed854204ec6342dcf6c091852d094ceb528beb7699a1e58d13f3072aa432e74a72ceee4ef57d6deb5963ddaeef15cbec267247a05c1cf2824a5a774bcf31e75f480e17b24568ba547d04ca9a905797cffee0fa309044389b5e23c2c2cb08c18f42a049b5f613f9c75c9cb42d57dc2181877dc8f7351a6d2c1ad81eba12d56b52f96609b696bb6e01ddec0efd893cca413f6b99216930ac4f0e152ac1773f18016323b408b8fc5e0b0acb46a515647cfe6678268ee85637381c8a0497559261e03205e057fcc3303fd0c9cb9183cb1de89c6ea5e7cd95aeb8b5a4413420035ff233d876d4480c0202462184a9a462afcd6502dd1b1badfd590609281fd68e0daf5ad62e2789c92763e843f0cb8cf5fdca9e847533c791a54ae574373e1f4fbc966d90f7fcc994859c7971050f7f'
);

INSERT INTO certificates (
   type, keytype, data
) VALUES ( /* C=CH, O=strongSwan Project, CN=venus.strongswan.org */
  1, 1, X'3082048a308202f2a003020102020106300d06092a864886f70d01010b05003047310b3009060355040613024348311b3019060355040a13127374726f6e675377616e2050726f6a656374311b3019060355040313127374726f6e675377616e20526f6f74204341301e170d3235313130363030313332365a170d3333313130363030313332365a3049310b3009060355040613024348311b3019060355040a13127374726f6e675377616e2050726f6a656374311d301b0603550403131476656e75732e7374726f6e677377616e2e6f7267308201a2300d06092a864886f70d01010105000382018f003082018a0282018100b66bf97a0689331703eecf26a9b85b507bc5d1c02e6c544156e3c155909c870f03c374e55fde4318b0c7212bdd9f98471eaac7da2f690b4d60ebb1849408f57d2dc7ff0e793cc23d227d025827ca744a4f2fbed6289d27fc034f0938f72defdfd6c562287d4aaf83c6149250d5e173861074cb9813f648450ef8e8c67031b50e4e78efe90c3ea7cd5ca11743f4f2de90f9aaf6ce71c186a7b37d517e2dc9b23c9685b530d44ba359b66084494fb85e471fbd45f8f67533ac71e203a305e6544e252ecea298e9bea9c72cd1edff934008a24034f596f61dac16ee1333bbba4cb0bd802820c88d759716992cc727986fb0ebaaf51ae0993444afe0a05cc59701f5c4c73904ee439c19723a2189a11b379f8e3a1b77ce77f8fb6a425e14cd1d5724762aab3c9dd544d627906470475fcbf5f4764730ec8cf07f370b31d5b2dfba453f7a92845030f77eaabafdabf3af6032c0633873d2d85cfbee322541fad2abcbcb3363a69f10bcc2d5ddffc90eb202d63f907e22d4d52e4c0a10341187f83d090203010001a37f307d301f0603551d23041830168014288a0bd0d28511dae59ffa160ab021d708922d67301f0603551d1104183016821476656e75732e7374726f6e677377616e2e6f726730390603551d1f04323030302ea02ca02a8628687474703a2f2f63726c2e7374726f6e677377616e2e6f72672f7374726f6e677377616e2e63726c300d06092a864886f70d01010b050003820181002b446e65b06af6d19e691640def0a0c52a9081858c2c3d95d389b7cd58dc350d748c7e3cf493248ed8a6dfb7332263b6aa023f78b69b973ea1c22246d51cb2b4ba8e2c5e65548dc8eca9f61edb57467584bca3f0eaae674e6289fca5070ee2b7e8554e071d48303af79b6826c791be3d52de9a5a4513898a551c09ecb07990eeebfa5a5b227cc8b7040b7e12ba667031e4aaa612c55488cc74b2927ac45204780480839fd5bdd4098632d0a45824b73cdbb5fc06f82f3fb25c2ee1a227791ce5645e98a984ac5f24aa4d061c01735289006059175ba01f3a0c56c3b9c01410bebfea3bccf64c02deae7ecc1b2e0f88aac74deab25e21d1fe822bb871e06a975580711eb84d0833e75e0b8d5df3382804fcff75e839869f394e1f4454728f3514dbb8001409daf57e5d4006dbfa3252ce781ba45ee795ccb9cf44d09f18fc06eecd4ebd1a6ff28ca5595f8f4d64ea38a3ab657ea1fcb92c83d0f4b77bfe8b5637278a9d9f708d17172705faded2ac7358605ca9d6a86b92bc8a9827138884e2ff'
);

INSERT INTO certificate_identity (
  certificate, identity
) VALUES (
  1, 1
);

INSERT INTO certificate_identity (
  certificate, identity
) VALUES (
  1, 2
);

INSERT INTO certificate_identity (
  certificate, identity
) VALUES (
  1, 3
);

INSERT INTO certificate_identity (
  certificate, identity
) VALUES (
  2, 4
);

INSERT INTO certificate_identity (
  certificate, identity
) VALUES (
  2, 6
);

/* Private Keys */

INSERT INTO private_keys (
   type, data
) VALUES ( /* key of 'C=CH, O=strongSwan Project, CN=venus.strongswan.org' */
  1, X'308206e30201000282018100b66bf97a0689331703eecf26a9b85b507bc5d1c02e6c544156e3c155909c870f03c374e55fde4318b0c7212bdd9f98471eaac7da2f690b4d60ebb1849408f57d2dc7ff0e793cc23d227d025827ca744a4f2fbed6289d27fc034f0938f72defdfd6c562287d4aaf83c6149250d5e173861074cb9813f648450ef8e8c67031b50e4e78efe90c3ea7cd5ca11743f4f2de90f9aaf6ce71c186a7b37d517e2dc9b23c9685b530d44ba359b66084494fb85e471fbd45f8f67533ac71e203a305e6544e252ecea298e9bea9c72cd1edff934008a24034f596f61dac16ee1333bbba4cb0bd802820c88d759716992cc727986fb0ebaaf51ae0993444afe0a05cc59701f5c4c73904ee439c19723a2189a11b379f8e3a1b77ce77f8fb6a425e14cd1d5724762aab3c9dd544d627906470475fcbf5f4764730ec8cf07f370b31d5b2dfba453f7a92845030f77eaabafdabf3af6032c0633873d2d85cfbee322541fad2abcbcb3363a69f10bcc2d5ddffc90eb202d63f907e22d4d52e4c0a10341187f83d090203010001028201800cc1483a73644ab796616f67cc486d0f17b66d5bf70b0149a7c80943c0b6a71d62459b81f1c5f6524ec2ffa363edc5ad9c5bf3d9224541a26d8f51545c2ef3ae46e213e808cb5a2800e63580a1389f50b65077f31cb81f5c784541977376096e90e37081750040bd319f8cdafcd77496c8460859c7f48999558a8b291bdd67e3da120bf153373acfa9c5443d8ece20088a427d5b123a663e49d72e78687e70b95a8b7b0fb0da608fb468337bb648a583ead8d6c08988089ecb4032c1a67714481b92b4d5059856b047fb9f7d3d8393af8409321a52ee8044a06f2e41f191c70471c97de240d916e76358fa42d753bd75fee501ffbd22d5e19f68187553b50b1b6f7103be00aa58af01409743c7c869891bbd44fd291a1e361ea0e69cd5b3f30e5c7f952b94db02b0e498c5c08af7f8205729e4d0cf32f7f027fe7f759d51d31c4f670fcbad8bbebbdc01393a8934b41e8c74cd9ec9fa9604da20faa6c480f480ab11065c6866d2786ba540940628b0f94217a40f5df46100940807d6cad35d410281c100f39c608174da9f88ecb97b7457f7e36431bc8f3cc25f1c186a56679f921ca4275b472dd7cacaefd2397d08541da3c93113752d75619124ab7a5c9d08f91574d80d1309b185ea7d02f3e6c9a758380ee30460e214ac34f3daa6c2fbd3bc186f630489b15f8e86d8e2e40fed41f08996dc94e084433ef5b3bee7bb99053970d2b4db5cb226507dcdf587d42353525d03253a756ade3509832d7f878c6791606f51774ab0c6f328d8bb88c547442a05993126854493fb18350751b96ac3793ea7490281c100bfb2f6ae83b05b4beaa66dd3f48f11309872607ee363e5fa91876ff669b955d076a364aec0aa3a445d447fe99a61193c46848b11147d8db9ce0bd4d2b25c65877113e88ad6cc0f87cb32f98f9d2f89d4b1368e90f22ff3bf4e96e20e52836f4fc7ee69423279d91c7bde5b70958f542da85671f95181f8f8b5e69064aa3534a34edc1a949334784ee7461ea62d17b6b604b9c09e4a8682daa3461ced97e12c185ccb7de1a2131189f907793a6ad4c8574b1e9da9b1858e8b9e925540b24027c10281c031539a9edbe060a942f593afcd181e6ced3d36eba097cd828c158ec9dab5fdef1226697be64e0d1d4e12a91b0f1d58e19d04fefd63921610baa8020c0d137123461272c6054da39e737069a87ece6b05409fb567662f1aa94d56f1d2bfa55af87bb4bdbb918a706410b5c0deb72bc4e64926e4e110e08352c66d4fe0a4eed95b51878573089d5094c4ba09a5176a49f6c1cd80a419ad21689708053ffb49c180875d124a567610dc782729f4fd6540cd98f5271ba79e112eb837890ca7822e310281c0694986f944b4e8ffe24a348a34891b7ce04df9b7d77677cace815fba2c4931dbc43d6bc01b6ba38306e2e78a4b534743f6cb37825309be7cadb18bdb8940fc368ea1cb97edefb81bf23bf61badce7d5a4756daa8bb8c20c9130605f4add7289cde0790e25dccd4b53347665b88996737887caa2eb058bd81048f35014506e1f94c07d1c586b04bdfb260add6c16f83d7a6f2cadb65bd49438267b0ddc20c5766ae18c9f3d24bbcd755e287efd0db3b89ce656b5cd776ae5afae60e52f15411410281c100a690aa86c26c7eac8194b2e1d2706caea657fe58e5c1f6db67e81524c8a960fdce3e9c39d57e4dd4d3f615b4d02d8d842cc83890218b1e67287113d654473d71e66a2d52b145ecb8900ed6d103d9e98f03ffaf930677f2c566b33a15df4ec177dd1509fa838dce7afc5f2599dc4ee832dc7ca1292a13c66f9b221cdf8d339c33316e85195a312e7f91e6fec8dd7c55a9899c0287a6ee3718957c245e616c8c9dca2c1b52364c4258e23f25b065cfa380f1a0a7fb3c4f261318f6bcb5d98944a2'
);

INSERT INTO private_key_identity (
  private_key, identity
) VALUES (
  1, 4
);

INSERT INTO private_key_identity (
  private_key, identity
) VALUES (
  1, 6
);

/* Configurations */

INSERT INTO ike_configs (
  local, remote
) VALUES (
  '10.1.0.20', '192.168.0.2'
);

INSERT INTO ike_configs (
  local, remote
) VALUES (
  '%any', '%any'
);

INSERT INTO peer_configs (
  name, ike_cfg, local_id, remote_id, virtual
) VALUES (
  'nat-t', 1, 4, 5, '0.0.0.0'
);

INSERT INTO peer_configs (
  name, ike_cfg, local_id, remote_id, auth_method
) VALUES (
  'shunts', 2, 7, 7, 0
);

INSERT INTO child_configs (
  name
) VALUES (
  'nat-t'
);

INSERT INTO child_configs (
  name, mode, start_action
) VALUES (
  'local-net', 4, 1
);

INSERT INTO peer_config_child_config (
  peer_cfg, child_cfg
) VALUES (
  1, 1
);

INSERT INTO peer_config_child_config (
  peer_cfg, child_cfg
) VALUES (
  2, 2
);

INSERT INTO traffic_selectors (
  type, start_addr, end_addr
) VALUES ( /* 10.1.0.0/16 */
  7, X'0a010000', X'0a01ffff'
);

INSERT INTO traffic_selectors (
  type, start_addr, end_addr
) VALUES ( /* 0.0.0.0/0 */
  7, X'00000000', X'ffffffff'
);

INSERT INTO traffic_selectors (
  type
) VALUES ( /* dynamic/32 */
  7
);

INSERT INTO child_config_traffic_selector (
  child_cfg, traffic_selector, kind
) VALUES (
  1, 2, 1
);

INSERT INTO child_config_traffic_selector (
	child_cfg, traffic_selector, kind
) VALUES (
  1, 3, 2
);

INSERT INTO child_config_traffic_selector (
	child_cfg, traffic_selector, kind
) VALUES (
  2, 1, 0
);

INSERT INTO child_config_traffic_selector (
	child_cfg, traffic_selector, kind
) VALUES (
  2, 1, 1
);
