PGDMP ! lbeacon8.1.108.1.10Rv00ENCODINGENCODINGSET client_encoding = 'UTF8'; falsew126217077beaconDATABASEDCREATE DATABASE beacon WITH TEMPLATE = template0 ENCODING = 'UTF8'; DROP DATABASE beacon; beaconfalse26152200publicSCHEMACREATE SCHEMA public; DROP SCHEMA public; beaconfalsex00 SCHEMA publicCOMMENT6COMMENT ON SCHEMA public IS 'Standard public schema'; beaconfalse5y00publicACLREVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM beacon; GRANT ALL ON SCHEMA public TO beacon; GRANT ALL ON SCHEMA public TO PUBLIC; beaconfalse5261217080plpgsqlPROCEDURAL LANGUAGE$CREATE PROCEDURAL LANGUAGE plpgsql; "DROP PROCEDURAL LANGUAGE plpgsql; false125517081)active_port(inet, integer, macaddr, inet)FUNCTIONBCREATE FUNCTION active_port(_ip_ inet, _port_ integer, _mac_ macaddr, _router_ inet) RETURNS integer AS $$ BEGIN UPDATE port_connection SET updated = now() WHERE device_ip = _ip_ and mac = _mac_ and router = _router_ and port = _port_; IF FOUND THEN RETURN 0; END IF; UPDATE port_connection SET router = _router_, port = _port_, updated = now() WHERE device_ip = _ip_ and mac = _mac_; IF FOUND THEN RETURN 1; END IF; INSERT INTO port_connection (device_ip, port, mac, router) VALUES (_ip_, _port_, _mac_, _router_); RETURN 2; END; $$ LANGUAGE plpgsql; [DROP FUNCTION public.active_port(_ip_ inet, _port_ integer, _mac_ macaddr, _router_ inet); publicbeaconfalse4545*1255170823arp_insert_handler(inet, macaddr, boolean, boolean)FUNCTION6CREATE FUNCTION arp_insert_handler(_ip_ inet, _mac_ macaddr, _arp_ boolean, _router_ boolean) RETURNS integer AS $$ DECLARE ipTable record; BEGIN FOR ipTable IN SELECT DISTINCT ip FROM arp_table WHERE ip = _ip_ LOOP --RAISE LOG 'removing data for (%)', ipTable.ip; DELETE FROM arp_table WHERE ip = ipTable.ip; PERFORM clear_ip_data(ipTable.ip); END LOOP; INSERT INTO arp_table (mac, ip, fromARP, knownRouter) VALUES (_mac_, _ip_, _arp_, _router_); PERFORM ip_data_update(_ip_, _mac_); RETURN 1; END; $$ LANGUAGE plpgsql; dDROP FUNCTION public.arp_insert_handler(_ip_ inet, _mac_ macaddr, _arp_ boolean, _router_ boolean); publicbeaconfalse45455125517083arp_timeout(integer)FUNCTIONjCREATE FUNCTION arp_timeout(_hour_ integer) RETURNS integer AS $$ DECLARE arpTable record; count integer; BEGIN count := 0; FOR arpTable IN SELECT * FROM arp_table WHERE updated < (now() - (_hour_ * interval '1 hour')) LOOP IF ( (SELECT 1 FROM node_stack WHERE node_stack.ip = arpTable.ip AND updated > (now() - (_hour_ * interval '1 hour')) LIMIT 1) = 1 OR (SELECT 1 FROM node_data WHERE node_data.ip = arpTable.ip AND updated > (now() - (_hour_ * interval '1 hour')) LIMIT 1) = 1 OR (SELECT 1 FROM node_software WHERE node_software.ip = arpTable.ip AND updated > (now() - (_hour_ * interval '1 hour')) LIMIT 1) = 1 OR (SELECT 1 FROM node_traffic WHERE node_traffic.ip = arpTable.ip AND updated > (now() - (_hour_ * interval '1 hour')) LIMIT 1) = 1 OR (SELECT 1 FROM ip_model, profile WHERE ip_model.ipaddr = arpTable.ip AND ip_model.profile = profile.name AND (profile.allow_timeout = 'f' OR profile.allow_timeout IS NULL) LIMIT 1) = 1 OR (SELECT 1 FROM mac_model, profile WHERE mac_model.mac = arpTable.mac AND mac_model.profile = profile.name AND (profile.allow_timeout = 'f' OR profile.allow_timeout IS NULL) LIMIT 1) = 1) THEN NULL; ELSE DELETE FROM node_stack WHERE mac IS NULL AND node_stack.ip = arpTable.ip; DELETE FROM node_software WHERE mac IS NULL AND node_software.ip = arpTable.ip; DELETE FROM node_traffic WHERE node_traffic.ip = arpTable.ip; DELETE FROM node_data WHERE mac IS NULL AND node_data.ip = arpTable.ip; DELETE FROM ip_model WHERE ip_model.ipaddr = arpTable.ip; DELETE FROM ets_ct_alias WHERE mac = arpTable.mac; DELETE FROM arp_table WHERE mac = arpTable.mac; count := count + 1; END IF; END LOOP; RETURN count; END; $$ LANGUAGE plpgsql; 2DROP FUNCTION public.arp_timeout(_hour_ integer); publicbeaconfalse4545(1255170843arp_update_handler(inet, macaddr, boolean, boolean)FUNCTIONOCREATE FUNCTION arp_update_handler(_ip_ inet, _mac_ macaddr, _arp_ boolean, _router_ boolean) RETURNS integer AS $$ DECLARE arpTable record; BEGIN FOR arpTable IN SELECT DISTINCT ip FROM arp_table WHERE mac = _mac_ LOOP PERFORM clear_ip_data(arpTable.ip); END LOOP; UPDATE arp_table SET updated = now(), ip = _ip_, fromARP = _arp_, knownRouter = _router_ WHERE mac = _mac_; PERFORM ip_data_update(_ip_, _mac_); DELETE FROM arp_table WHERE arp_table.ip = _ip_ and arp_table.mac != _mac_; PERFORM clear_ip_data(_ip_); RETURN 1; END; $$ LANGUAGE plpgsql; dDROP FUNCTION public.arp_update_handler(_ip_ inet, _mac_ macaddr, _arp_ boolean, _router_ boolean); publicbeaconfalse4545 125517085check_cca(macaddr)FUNCTIONCREATE FUNCTION check_cca(_mac_ macaddr) RETURNS integer AS $$ BEGIN IF (SELECT 1 FROM asset_tracking WHERE mac = _mac_ and addmac = 't') THEN RETURN 1; ELSE RETURN 0; END IF; END; $$ LANGUAGE plpgsql; /DROP FUNCTION public.check_cca(_mac_ macaddr); publicbeaconfalse4545/125517086check_cdp_info(inet)FUNCTIONUCREATE FUNCTION check_cdp_info(_sip_ inet) RETURNS void AS $$ BEGIN DELETE FROM trunk_ports WHERE method = '1' AND device_ip = _sip_ and updated < (now() - (30 * interval '1 minute')); DELETE FROM network_neighbor WHERE device_ip = _sip_ and updated < (now() - (30 * interval '1 minute')); RETURN; END; $$ LANGUAGE plpgsql; 1DROP FUNCTION public.check_cdp_info(_sip_ inet); publicbeaconfalse4545&125517087clear_ip_data(inet)FUNCTIONCREATE FUNCTION clear_ip_data(_ip_ inet) RETURNS integer AS $$ BEGIN DELETE FROM ip_model WHERE ipaddr = _ip_; DELETE FROM node_software WHERE ip = _ip_ and mac IS NULL; DELETE FROM node_stack WHERE ip = _ip_ and mac IS NULL; DELETE FROM node_traffic WHERE ip = _ip_; DELETE FROM node_data WHERE ip = _ip_ and mac IS NULL and data_type != '2' and data_type != '3' and data_type != '4' and data_type != '5'; RETURN 1; END; $$ LANGUAGE plpgsql; /DROP FUNCTION public.clear_ip_data(_ip_ inet); publicbeaconfalse4545%125517088"delete_profile_data(inet, macaddr)FUNCTIONCREATE FUNCTION delete_profile_data(_ip_ inet, _mac_ macaddr) RETURNS integer AS $$ BEGIN DELETE FROM ets_ct_alias WHERE mac = _mac_; DELETE FROM ip_model WHERE ipaddr = _ip_; DELETE FROM mac_model WHERE mac = _mac_; DELETE FROM node_software WHERE (ip = _ip_ or mac = _mac_); DELETE FROM node_stack WHERE (ip = _ip_ or mac = _mac_); DELETE FROM node_traffic WHERE ip = _ip_; -- Note the type == 1. these are URLs and DHCP will be set before the ARP data arrives DELETE FROM node_data WHERE (ip = _ip_ or mac = _mac_) and data_type != '2' and data_type != '3' and data_type != '4' and data_type != '5'; RETURN 1; END; $$ LANGUAGE plpgsql; DDROP FUNCTION public.delete_profile_data(_ip_ inet, _mac_ macaddr); publicbeaconfalse45452125517089directory_timeout(integer)FUNCTIONCREATE FUNCTION directory_timeout(_day_ integer) RETURNS integer AS $$ DECLARE macTable record; arpTable record; count integer; BEGIN count := 0; FOR macTable IN SELECT * FROM profile_directory WHERE updated < (now() - (_day_ * interval '1 day')) LOOP IF (SELECT 1 FROM arp_table WHERE arp_table.mac = macTable.mac LIMIT 1) THEN SELECT INTO arpTable * FROM arp_table WHERE arp_table.mac = macTable.mac; IF ( (SELECT 1 FROM node_stack WHERE node_stack.ip = arpTable.ip AND updated > (now() - (_day_ * interval '1 day')) LIMIT 1) = 1 OR (SELECT 1 FROM node_data WHERE node_data.mac = macTable.mac AND updated > (now() - (_day_ * interval '1 day')) LIMIT 1) = 1 OR (SELECT 1 FROM node_software WHERE node_software.ip = arpTable.ip AND updated > (now() - (_day_ * interval '1 day')) LIMIT 1) = 1 OR (SELECT 1 FROM node_traffic WHERE node_traffic.ip = arpTable.ip AND updated > (now() - (_day_ * interval '1 day')) LIMIT 1) = 1 OR (SELECT 1 FROM arp_table WHERE arp_table.mac = macTable.mac AND updated > (now() - (_day_ * interval '1 day')) LIMIT 1) = 1 OR (SELECT 1 FROM port_connection WHERE port_connection.mac = macTable.mac AND updated > (now() - (_day_ * interval '1 day')) LIMIT 1) = 1 ) THEN NULL; ELSE DELETE FROM profile_directory WHERE mac = macTable.mac; UPDATE asset_tracking SET retired = 't', retiredAt = now() WHERE mac = macTable.mac; count := count + 1; END IF; ELSE IF ((SELECT 1 FROM node_data WHERE node_data.mac = macTable.mac AND updated > (now() - (_day_ * interval '1 day')) LIMIT 1) = 1 OR (SELECT 1 FROM port_connection WHERE port_connection.mac = macTable.mac AND updated > (now() - (_day_ * interval '1 day')) LIMIT 1) = 1) THEN NULL; ELSE DELETE FROM profile_directory WHERE mac = macTable.mac; UPDATE asset_tracking SET retired = 't', retiredAt = now() WHERE mac = macTable.mac; count := count + 1; END IF; END IF; END LOOP; RETURN count; END; $$ LANGUAGE plpgsql; 7DROP FUNCTION public.directory_timeout(_day_ integer); publicbeaconfalse4545'125517090ip_data_update(inet, macaddr)FUNCTIONCREATE FUNCTION ip_data_update(_ip_ inet, _mac_ macaddr) RETURNS integer AS $$ BEGIN UPDATE node_software SET ip = '0.0.0.0' WHERE mac != _mac_ and ip = _ip_; UPDATE node_stack SET ip = '0.0.0.0' WHERE mac != _mac_ and ip = _ip_; UPDATE node_data SET ip = '0.0.0.0' WHERE mac != _mac_ and ip = _ip_; UPDATE node_software SET ip = _ip_ WHERE mac = _mac_; UPDATE node_stack SET ip = _ip_ WHERE mac = _mac_; UPDATE node_data SET ip = _ip_ WHERE mac = _mac_; RETURN 1; END; $$ LANGUAGE plpgsql; ?DROP FUNCTION public.ip_data_update(_ip_ inet, _mac_ macaddr); publicbeaconfalse4545125517091#mac_history(inet, integer, macaddr)FUNCTION%CREATE FUNCTION mac_history(_ip_ inet, _port_ integer, _mac_ macaddr) RETURNS integer AS $$ BEGIN UPDATE mac_history SET updated = now() WHERE device_ip = _ip_ and mac = _mac_ and port = _port_ and (removed = 'f' or removed IS NULL); IF FOUND THEN RETURN 0; END IF; UPDATE mac_history SET removed = 'f', updated = now() WHERE device_ip = _ip_ and mac = _mac_ and port = _port_; IF FOUND THEN RETURN 1; END IF; INSERT INTO mac_history (device_ip, port, mac) VALUES (_ip_, _port_, _mac_); RETURN 2; END; $$ LANGUAGE plpgsql; LDROP FUNCTION public.mac_history(_ip_ inet, _port_ integer, _mac_ macaddr); publicbeaconfalse45454125517092port_timeout(integer)FUNCTION^ CREATE FUNCTION port_timeout(_hour_ integer) RETURNS integer AS $$ DECLARE portTable record; arpTable record; clean integer; count integer; BEGIN count := 0; FOR portTable IN SELECT * FROM port_connection WHERE updated < (now() - (_hour_ * interval '1 hour')) and (device_ip,port) NOT IN (SELECT device_ip, port FROM trunk_ports) LOOP clean := 0; IF (SELECT 1 FROM arp_table WHERE arp_table.mac = portTable.mac LIMIT 1) THEN SELECT INTO arpTable * FROM arp_table WHERE arp_table.mac = portTable.mac; IF ( (SELECT 1 FROM node_stack WHERE node_stack.ip = arpTable.ip AND updated > (now() - (_hour_ * interval '1 hour')) LIMIT 1) = 1 OR (SELECT 1 FROM node_data WHERE node_data.ip = arpTable.ip AND updated > (now() - (_hour_ * interval '1 hour')) LIMIT 1) = 1 OR (SELECT 1 FROM node_software WHERE node_software.ip = arpTable.ip AND updated > (now() - (_hour_ * interval '1 hour')) LIMIT 1) = 1 OR (SELECT 1 FROM node_traffic WHERE node_traffic.ip = arpTable.ip AND updated > (now() - (_hour_ * interval '1 hour')) LIMIT 1) = 1 OR (SELECT 1 FROM ip_model, profile WHERE ip_model.ipaddr = arpTable.ip AND ip_model.profile = profile.name AND (profile.allow_timeout = 'f' OR profile.allow_timeout IS NULL) LIMIT 1) = 1 OR (SELECT 1 FROM mac_model, profile WHERE mac_model.mac = arpTable.mac AND mac_model.profile = profile.name AND (profile.allow_timeout = 'f' OR profile.allow_timeout IS NULL) LIMIT 1) = 1) THEN NULL; ELSE DELETE FROM node_stack WHERE mac IS NULL AND node_stack.ip = arpTable.ip; DELETE FROM node_software WHERE mac IS NULL AND node_software.ip = arpTable.ip; DELETE FROM node_traffic WHERE node_traffic.ip = arpTable.ip; DELETE FROM node_data WHERE mac IS NULL AND node_data.ip = arpTable.ip; DELETE FROM ip_model WHERE ip_model.ipaddr = arpTable.ip; DELETE FROM ets_ct_alias WHERE mac = arpTable.mac; DELETE FROM arp_table WHERE mac = arpTable.mac; clean := 1; END IF; ELSE clean := 1; END IF; IF (clean) THEN --UPDATE network_port SET link_state = '2' WHERE device_ip = portTable.device_ip AND port = portTable.port; UPDATE mac_history SET removed = 't', removedAt = now() WHERE device_ip = portTable.device_ip AND port = portTable.port; --DELETE FROM ets_ct_alias WHERE mac = portTable.mac; --DELETE FROM mac_model WHERE mac = portTable.mac; --DELETE FROM arp_table WHERE arp_table.mac = portTable.mac; DELETE FROM port_connection WHERE device_ip = portTable.device_ip and port = portTable.port; count := count + 1; END IF; END LOOP; RETURN count; END; $$ LANGUAGE plpgsql; 3DROP FUNCTION public.port_timeout(_hour_ integer); publicbeaconfalse45451125517093prune_trunk_conn()FUNCTIONCREATE FUNCTION prune_trunk_conn() RETURNS void AS $$ DECLARE trunkTable record; BEGIN FOR trunkTable IN SELECT DISTINCT device_ip, port FROM trunk_ports LOOP DELETE FROM port_connection WHERE device_ip = trunkTable.device_ip and port = trunkTable.port and mac NOT IN (SELECT mac FROM network_port) and updated < (now() - (6 * interval '1 hour')); END LOOP; RETURN; END; $$ LANGUAGE plpgsql; )DROP FUNCTION public.prune_trunk_conn(); publicbeaconfalse45459125517094remove_mac_auth(macaddr, text)FUNCTIONCREATE FUNCTION remove_mac_auth(_mac_ macaddr, _pro_ text) RETURNS integer AS $$ DECLARE proRecord record; BEGIN UPDATE asset_tracking SET proTime = now(), profile = 'Unknown', authorized = 'f', authTime = now() WHERE mac = _mac_; SELECT INTO proRecord * FROM profile WHERE name = _pro_; IF FOUND THEN DELETE FROM static_profile WHERE mac = _mac_ and rule_id = proRecord.serial_id; END IF; RETURN 1; END; $$ LANGUAGE plpgsql; ADROP FUNCTION public.remove_mac_auth(_mac_ macaddr, _pro_ text); publicbeaconfalse4545"125517095remove_port(inet, integer)FUNCTION1CREATE FUNCTION remove_port(_ip_ inet, _port_ integer) RETURNS integer AS $$ BEGIN UPDATE network_port SET link_state = '2', auth_user = '' WHERE device_ip = _ip_ AND port = _port_; DELETE FROM port_connection WHERE device_ip = _ip_ and port = _port_; RETURN 0; END; $$ LANGUAGE plpgsql; =DROP FUNCTION public.remove_port(_ip_ inet, _port_ integer); publicbeaconfalse4545)125517096repl_ets_roles(integer)FUNCTIONCREATE FUNCTION repl_ets_roles(_index_ integer) RETURNS integer AS $$ DECLARE devices record; roles record; BEGIN FOR devices IN SELECT serial_id FROM network_device WHERE serial_id != _index_ LOOP FOR roles IN SELECT name FROM device_role WHERE device_id = _index_ LOOP INSERT INTO device_role (device_id, single, name) VALUES (devices.serial_id, 't', roles.name); END LOOP; END LOOP; RETURN 1; END; $$ LANGUAGE plpgsql; 6DROP FUNCTION public.repl_ets_roles(_index_ integer); publicbeaconfalse45456125517097set_active(inet, integer)FUNCTIONCREATE FUNCTION set_active(_ip_ inet, _type_ integer) RETURNS integer AS $$ BEGIN IF (_type_ = 1) THEN UPDATE active_scan SET active = 't', pingable = 't', last_scan = now() WHERE ipaddr = _ip_; IF FOUND THEN RETURN 0; END IF; INSERT INTO active_scan (ipaddr, active, pingable) VALUES (_ip_, 't', 't'); ELSIF (_type_ = 6) THEN UPDATE active_scan SET active = 't', tcp_ping = 't', last_scan = now() WHERE ipaddr = _ip_; IF FOUND THEN RETURN 0; END IF; INSERT INTO active_scan (ipaddr, active, tcp_ping) VALUES (_ip_, 't', 't'); END IF; RETURN 1; END; $$ LANGUAGE plpgsql; <DROP FUNCTION public.set_active(_ip_ inet, _type_ integer); publicbeaconfalse4545125517098set_asset_arp(inet, macaddr)FUNCTION7CREATE FUNCTION set_asset_arp(_ip_ inet, _mac_ macaddr) RETURNS integer AS $$ BEGIN UPDATE asset_tracking SET arpTime = now(), ipaddr = _ip_ WHERE mac = _mac_; IF FOUND THEN RETURN 0; END IF; INSERT INTO asset_tracking (ipaddr, mac) VALUES (_ip_, _mac_); RETURN 1; END; $$ LANGUAGE plpgsql; >DROP FUNCTION public.set_asset_arp(_ip_ inet, _mac_ macaddr); publicbeaconfalse4545125517099*set_asset_location(inet, integer, macaddr)FUNCTIONiCREATE FUNCTION set_asset_location(_ip_ inet, _port_ integer, _mac_ macaddr) RETURNS integer AS $$ BEGIN UPDATE asset_tracking SET locTime = now(), device = _ip_, port = _port_ WHERE mac = _mac_; IF FOUND THEN RETURN 0; END IF; INSERT INTO asset_tracking (device, port, mac) VALUES (_ip_, _port_, _mac_); RETURN 1; END; $$ LANGUAGE plpgsql; SDROP FUNCTION public.set_asset_location(_ip_ inet, _port_ integer, _mac_ macaddr); publicbeaconfalse4545125517100set_cca_mac(macaddr, boolean)FUNCTION-CREATE FUNCTION set_cca_mac(_mac_ macaddr, _flag_ boolean) RETURNS integer AS $$ BEGIN UPDATE asset_tracking SET addmac = _flag_ WHERE mac = _mac_; IF FOUND THEN RETURN 0; END IF; INSERT INTO asset_tracking (addmac, mac) VALUES (_flag_, _mac_); RETURN 1; END; $$ LANGUAGE plpgsql; ADROP FUNCTION public.set_cca_mac(_mac_ macaddr, _flag_ boolean); publicbeaconfalse4545125517101set_dns_name(inet, text)FUNCTIONhCREATE FUNCTION set_dns_name(_ip_ inet, _dns_ text) RETURNS integer AS $$ BEGIN UPDATE node_name SET updated = now() WHERE ip = _ip_ and dns = _dns_; IF FOUND THEN RETURN 0; END IF; DELETE FROM node_name WHERE dns = _dns_ and ip != _ip_; INSERT INTO node_name (ip, dns) VALUES (_ip_, _dns_); RETURN 1; END; $$ LANGUAGE plpgsql; :DROP FUNCTION public.set_dns_name(_ip_ inet, _dns_ text); publicbeaconfalse4545:125517102)set_location_dhcp(macaddr, macaddr, text)FUNCTIONoCREATE FUNCTION set_location_dhcp(_mac_ macaddr, _switchmac_ macaddr, _portname_ text) RETURNS integer AS $$ DECLARE netPort record; netDev record; BEGIN SELECT INTO netDev * FROM network_port WHERE network_port.mac = _switchmac_ LIMIT 1; IF NOT FOUND THEN RETURN 0; END IF; SELECT INTO netPort * FROM network_port WHERE network_port.device_ip = netDev.device_ip and network_port.port_name LIKE _portname_ LIMIT 1; IF NOT FOUND THEN RETURN 0; END IF; UPDATE port_connection SET port = netPort.port, updated = now() WHERE mac = _mac_ and device_ip = netDev.device_ip; IF FOUND THEN DELETE FROM port_connection WHERE mac = _mac_ and device_ip = netDev.device_ip and port != netPort.port; ELSE INSERT INTO port_connection (mac, device_ip, port) VALUES (_mac_, netDev.device_ip, netPort.port); END IF; RETURN 1; END; $$ LANGUAGE plpgsql; ]DROP FUNCTION public.set_location_dhcp(_mac_ macaddr, _switchmac_ macaddr, _portname_ text); publicbeaconfalse45458125517103set_mac_auth(macaddr, text)FUNCTIONCREATE FUNCTION set_mac_auth(_mac_ macaddr, _pro_ text) RETURNS integer AS $$ DECLARE proRecord record; BEGIN UPDATE asset_tracking SET proTime = now(), profile = _pro_, authorized = 't', authTime = now() WHERE mac = _mac_; IF NOT FOUND THEN INSERT INTO asset_tracking (profile, mac, authorized) VALUES (_pro_, _mac_, 't'); END IF; SELECT INTO proRecord * FROM profile WHERE name = _pro_; IF FOUND THEN UPDATE static_profile SET cf = '99' WHERE mac = _mac_ and rule_id = proRecord.serial_id; IF NOT FOUND THEN INSERT INTO static_profile (mac, rule_id, cf, active) VALUES (_mac_, proRecord.serial_id, '98', 't'); END IF; END IF; RETURN 1; END; $$ LANGUAGE plpgsql; >DROP FUNCTION public.set_mac_auth(_mac_ macaddr, _pro_ text); publicbeaconfalse4545;125517104&set_mac_change(macaddr, inet, integer)FUNCTIONCREATE FUNCTION set_mac_change(_mac_ macaddr, _ip_ inet, _port_ integer) RETURNS integer AS $$ DECLARE BEGIN UPDATE port_connection SET port = _port_, updated = now() WHERE mac = _mac_ and device_ip = _ip_; IF FOUND THEN DELETE FROM port_connection WHERE mac = _mac_ and device_ip = _ip_ and port != _port_; ELSE INSERT INTO port_connection (mac, device_ip, port) VALUES (_mac_, _ip_, _port_); END IF; RETURN 1; END; $$ LANGUAGE plpgsql; ODROP FUNCTION public.set_mac_change(_mac_ macaddr, _ip_ inet, _port_ integer); publicbeaconfalse4545#125517105set_model_history(inet, text)FUNCTIONCREATE FUNCTION set_model_history(_ip_ inet, _pro_ text) RETURNS integer AS $$ DECLARE proTable record; BEGIN SELECT INTO proTable profile FROM ip_model_historical where ipaddr = _ip_ ORDER BY model_time DESC LIMIT 1; IF (proTable.profile = _pro_) THEN NULL; ELSE INSERT INTO ip_model_historical (ipaddr, profile) VALUES (_ip_, _pro_); END IF; RETURN 1; END; $$ LANGUAGE plpgsql; ?DROP FUNCTION public.set_model_history(_ip_ inet, _pro_ text); publicbeaconfalse4545$125517106*set_model_history_mac(macaddr, text, inet)FUNCTIONCREATE FUNCTION set_model_history_mac(_mac_ macaddr, _pro_ text, _ip_ inet) RETURNS integer AS $$ DECLARE proTable record; BEGIN SELECT INTO proTable profile FROM mac_model_historical where mac = _mac_ ORDER BY model_time DESC LIMIT 1; IF (proTable.profile = _pro_) THEN NULL; ELSE INSERT INTO mac_model_historical (mac, profile, ipaddr) VALUES (_mac_, _pro_, _ip_); END IF; RETURN 1; END; $$ LANGUAGE plpgsql; RDROP FUNCTION public.set_model_history_mac(_mac_ macaddr, _pro_ text, _ip_ inet); publicbeaconfalse4545125517107Eset_software(inet, integer, integer, boolean, text, integer, boolean)FUNCTION CREATE FUNCTION set_software(_ip_ inet, _port_ integer, _proto_ integer, _server_ boolean, _data_ text, _type_ integer, _active_ boolean) RETURNS integer AS $$ DECLARE arpTable record; BEGIN SELECT INTO arpTable * FROM arp_table WHERE arp_table.ip = _ip_ and arp_table.fromarp = 't'; IF (_type_ = 1) THEN UPDATE node_software SET ip = _ip_, updated = now(), active = _active_ WHERE (mac IS NULL or mac = arpTable.mac) and (ip = _ip_ or mac = arpTable.mac) and port = _port_ and protocol = _proto_ and server = _server_ and data = _data_; IF FOUND THEN RETURN 0; END IF; UPDATE node_software SET ip = _ip_, data = _data_, updated = now(), active = _active_ WHERE (mac IS NULL or mac = arpTable.mac) and (ip = _ip_ or mac = arpTable.mac) and port = _port_ and protocol = _proto_ and server = _server_; IF FOUND THEN RETURN 1; END IF; DELETE FROM node_software WHERE ((mac IS NOT NULL and mac = arpTable.mac) or ip = _ip_) and port = _port_ and protocol = _proto_ and server = _server_; INSERT INTO node_software (ip, port, protocol, server, data, mac, active) VALUES (_ip_, _port_, _proto_, _server_, _data_, arpTable.mac, _active_); RETURN 1; ELSE UPDATE node_software SET updated = now(), active = _active_ WHERE (mac IS NULL or mac = arpTable.mac) and (ip = _ip_ or mac = arpTable.mac) and port = _port_ and protocol = _proto_ and server = _server_ and data = _data_; IF FOUND THEN RETURN 0; END IF; INSERT INTO node_software (ip, port, protocol, server, data, mac, active) VALUES (_ip_, _port_, _proto_, _server_, _data_, arpTable.mac, _active_); RETURN 1; END IF; RETURN 0; END; $$ LANGUAGE plpgsql; DROP FUNCTION public.set_software(_ip_ inet, _port_ integer, _proto_ integer, _server_ boolean, _data_ text, _type_ integer, _active_ boolean); publicbeaconfalse4545125517108Bset_stack(inet, integer, boolean, integer, integer, integer, text)FUNCTIONgCREATE FUNCTION set_stack(_ip_ inet, _ttl_ integer, _df_ boolean, _mss_ integer, _win_ integer, _scale_ integer, _list_ text) RETURNS integer AS $$ DECLARE arpTable record; BEGIN SELECT INTO arpTable * FROM arp_table WHERE arp_table.ip = _ip_ and arp_table.fromarp = 't'; UPDATE node_stack SET ip = _ip_, updated = now() WHERE (mac IS NULL or mac = arpTable.mac) and (ip = _ip_ or mac = arpTable.mac) and ttl = _ttl_ and df = _df_ and mss = _mss_ and window = _win_ and scale = _scale_ and list = _list_; IF FOUND THEN RETURN 0; END IF; UPDATE node_stack SET ip = _ip_, updated = now(), ttl = _ttl_, df = _df_, mss = _mss_, window = _win_, scale = _scale_, list = _list_ WHERE (mac IS NULL or mac = arpTable.mac) and (ip = _ip_ or mac = arpTable.mac); IF FOUND THEN RETURN 1; END IF; DELETE FROM node_stack WHERE (mac IS NOT NULL and mac = arpTable.mac) or ip = _ip_; INSERT INTO node_stack (ip, ttl, df, mss, window, scale, list, mac) VALUES (_ip_, _ttl_, _df_, _mss_, _win_, _scale_, _list_, arpTable.mac); RETURN 1; END; $$ LANGUAGE plpgsql; DROP FUNCTION public.set_stack(_ip_ inet, _ttl_ integer, _df_ boolean, _mss_ integer, _win_ integer, _scale_ integer, _list_ text); publicbeaconfalse4545125517109set_sysinfo(inet, text, text)FUNCTION/CREATE FUNCTION set_sysinfo(_ip_ inet, _match_ text, _data_ text) RETURNS integer AS $$ BEGIN UPDATE node_data SET updated = now() WHERE ip = _ip_ and data_type = '6' and match_name = _match_ and data = _data_; IF FOUND THEN RETURN 0; END IF; UPDATE node_data SET updated = now(), match_name = _match_, data = _data_ WHERE ip = _ip_ and data_type = '6'; IF FOUND THEN RETURN 1; END IF; INSERT INTO node_data (ip, data_type, match_name, data) VALUES (_ip_, '6', _match_, _data_); RETURN 1; END; $$ LANGUAGE plpgsql; HDROP FUNCTION public.set_sysinfo(_ip_ inet, _match_ text, _data_ text); publicbeaconfalse45451255171102set_traffic(inet, integer, inet, integer, integer)FUNCTIONCREATE FUNCTION set_traffic(_ip_ inet, _proto_ integer, _altip_ inet, _sport_ integer, _dport_ integer) RETURNS integer AS $$ BEGIN UPDATE node_traffic SET updated = now() WHERE ip = _ip_ and alt_ip = _altip_ and sport = _sport_ and dport = _dport_ and protocol = _proto_; IF FOUND THEN RETURN 0; END IF; INSERT INTO node_traffic (ip, protocol, alt_ip, sport, dport) VALUES (_ip_, _proto_, _altip_, _sport_, _dport_); RETURN 1; END; $$ LANGUAGE plpgsql; nDROP FUNCTION public.set_traffic(_ip_ inet, _proto_ integer, _altip_ inet, _sport_ integer, _dport_ integer); publicbeaconfalse4545125517111set_url(inet, text, text)FUNCTIONCREATE FUNCTION set_url(_ip_ inet, _match_ text, _data_ text) RETURNS integer AS $$ DECLARE arpTable record; BEGIN SELECT INTO arpTable * FROM arp_table WHERE arp_table.ip = _ip_ and arp_table.fromarp = 't'; UPDATE node_data SET ip = _ip_, updated = now() WHERE (mac IS NULL or mac = arpTable.mac) and (ip = _ip_ or mac = arpTable.mac) and data_type = '1' and match_name = _match_ and data = _data_; IF FOUND THEN RETURN 0; END IF; DELETE FROM node_data WHERE ((mac IS NOT NULL and mac = arpTable.mac) or ip = _ip_) and data = _data_ and data_type = '1'; INSERT INTO node_data (ip, data_type, match_name, data, mac) VALUES (_ip_, '1', _match_, _data_, arpTable.mac); RETURN 1; END; $$ LANGUAGE plpgsql; DDROP FUNCTION public.set_url(_ip_ inet, _match_ text, _data_ text); publicbeaconfalse4545-1255171129store_dhcp_data(macaddr, integer, text, text, text, text)FUNCTIONCREATE FUNCTION store_dhcp_data(_mac_ macaddr, _inform_ integer, _data2_ text, _data3_ text, _data4_ text, _data5_ text) RETURNS integer AS $$ DECLARE dhcpTable record; ipTable record; retVal integer; rowCount integer; BEGIN retVal := 0; rowCount := 0; IF (SELECT 1 FROM node_data WHERE mac = _mac_ LIMIT 1) THEN IF (_inform_ = 0) THEN --RAISE LOG 'mac is present. inform not set'; FOR dhcpTable IN SELECT * FROM node_data WHERE mac = _mac_ AND (data = _data2_ OR data = _data3_ OR data = _data4_ OR data = _data5_ OR (data_type = '5' and data IS NULL)) LOOP rowCount := rowCount + 1; END LOOP; if (rowCount != 4) THEN --RAISE LOG 'Row count does not match'; FOR ipTable IN SELECT DISTINCT ip FROM node_data WHERE mac = _mac_ and ip != '0.0.0.0' LOOP --RAISE LOG 'removing data for (%)', ipTable.ip; DELETE FROM arp_table WHERE ip = ipTable.ip; PERFORM delete_profile_data(ipTable.ip, _mac_); DELETE FROM node_data WHERE ip = ipTable.ip; END LOOP; DELETE FROM node_data WHERE mac = _mac_; INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '2', _data2_, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '3', _data3_, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '4', _data4_, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '5', _data5_, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '7', NULL, '0.0.0.0'); retVal := 1; ELSE --RAISE LOG 'Row count matchs'; UPDATE node_data SET ip = '0.0.0.0', updated = now() WHERE mac = _mac_; UPDATE node_data SET data = _data5_ WHERE mac = _mac_ and data_type = '5'; END IF; ELSE --RAISE LOG 'mac is present. inform set'; -- Just check to ensure that the vendor class matches IF (SELECT 1 FROM node_data WHERE mac = _mac_ AND data = _data3_ LIMIT 1) THEN UPDATE node_data SET updated = now() WHERE mac = _mac_; UPDATE node_data SET data = _data5_ WHERE mac = _mac_ and data_type = '7'; ELSE DELETE FROM node_data WHERE mac = _mac_; INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '2', _data2_, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '3', _data3_, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '4', _data4_, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '5', NULL, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '7', _data5_, '0.0.0.0'); retVal := 1; END IF; END IF; ELSE --RAISE LOG 'clean insert'; INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '2', _data2_, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '3', _data3_, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '4', _data4_, '0.0.0.0'); IF (_inform_ = 0) THEN INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '5', _data5_, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '7', NULL, '0.0.0.0'); ELSE INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '5', NULL, '0.0.0.0'); INSERT INTO node_data (mac, data_type, data, ip) VALUES (_mac_, '7', _data5_, '0.0.0.0'); END IF; retVal := 1; END IF; --RAISE LOG 'returning (%)', retVal; RETURN retVal; END; $$ LANGUAGE plpgsql; DROP FUNCTION public.store_dhcp_data(_mac_ macaddr, _inform_ integer, _data2_ text, _data3_ text, _data4_ text, _data5_ text); publicbeaconfalse4545+125517113update_arp_data(inet, macaddr)FUNCTION-CREATE FUNCTION update_arp_data(_ip_ inet, _mac_ macaddr) RETURNS integer AS $$ DECLARE arpTable record; ipTable record; BEGIN IF (SELECT 1 FROM arp_table WHERE mac = _mac_ LIMIT 1) THEN UPDATE arp_table SET updated = now(), fromARP = 't', knownRouter = 'f' WHERE mac = _mac_ and ip = _ip_; IF FOUND THEN RETURN 0; END IF; PERFORM arp_update_handler(_ip_, _mac_, 't', 'f'); RETURN 1; ELSE PERFORM arp_insert_handler(_ip_, _mac_, 't', 'f'); RETURN 1; END IF; RETURN 0; END; $$ LANGUAGE plpgsql; @DROP FUNCTION public.update_arp_data(_ip_ inet, _mac_ macaddr); publicbeaconfalse4545,125517114.update_arp_data_router(inet, macaddr, integer)FUNCTIONCREATE FUNCTION update_arp_data_router(_ip_ inet, _mac_ macaddr, _trust_ integer) RETURNS integer AS $$ DECLARE arpTable record; ipTable record; BEGIN IF (SELECT 1 FROM arp_table WHERE mac = _mac_ LIMIT 1) THEN IF (_trust_ = 1) THEN UPDATE arp_table SET updated = now(), knownRouter = 't' WHERE mac = _mac_ and ip = _ip_ AND (fromARP = 'f' OR fromARP IS NULL); IF FOUND THEN RETURN 0; END IF; IF (SELECT 1 FROM arp_table WHERE mac = _mac_ AND (fromARP = 'f' OR fromARP IS NULL) LIMIT 1) THEN PERFORM arp_update_handler(_ip_, _mac_, 'f', 't'); RETURN 1; END IF; ELSE UPDATE arp_table SET updated = now() WHERE mac = _mac_ and ip = _ip_ AND (fromARP = 'f' OR fromARP IS NULL) AND (knownRouter = 'f' OR knownRouter IS NULL); IF FOUND THEN RETURN 0; END IF; IF (SELECT 1 FROM arp_table WHERE mac = _mac_ AND (fromARP = 'f' OR fromARP IS NULL) AND (knownRouter = 'f' OR knownRouter IS NULL) LIMIT 1) THEN PERFORM arp_update_handler(_ip_, _mac_, 'f', 'f'); RETURN 1; END IF; END IF; ELSE -- MAC not present IF (SELECT 1 FROM arp_table WHERE ip = _ip_ AND fromARP = 't' LIMIT 1) THEN NULL; ELSE IF (_trust_ = 1) THEN PERFORM arp_insert_handler(_ip_, _mac_, 'f', 't'); ELSE PERFORM arp_insert_handler(_ip_, _mac_, 'f', 'f'); END IF; END IF; RETURN 1; END IF; RETURN 0; END; $$ LANGUAGE plpgsql; XDROP FUNCTION public.update_arp_data_router(_ip_ inet, _mac_ macaddr, _trust_ integer); publicbeaconfalse45451255171152update_authuser_history(inet, integer, text, text)FUNCTIONCREATE FUNCTION update_authuser_history(_ip_ inet, _port_ integer, _user_ text, _name_ text) RETURNS integer AS $$ BEGIN UPDATE auth_user_history SET updated = now() WHERE device_ip = _ip_ and port = _port_ and auth_user = _user_; IF FOUND THEN RETURN 0; END IF; INSERT INTO auth_user_history (device_ip, port, auth_user, port_name) VALUES (_ip_, _port_, _user_, _name_); RETURN 1; END; $$ LANGUAGE plpgsql; cDROP FUNCTION public.update_authuser_history(_ip_ inet, _port_ integer, _user_ text, _name_ text); publicbeaconfalse4545.125517116<update_cdp_info(inet, integer, inet, text, text, text, text)FUNCTION@CREATE FUNCTION update_cdp_info(_sip_ inet, _port_ integer, _dip_ inet, _ver_ text, _name_ text, _pname_ text, _plat_ text) RETURNS void AS $$ BEGIN UPDATE network_neighbor SET ipaddr = _dip_, version = _ver_, device_name = _name_, port_name = _pname_, platform = _plat_, updated = now() WHERE device_ip = _sip_ AND port = _port_; IF FOUND THEN RETURN; END IF; INSERT INTO network_neighbor (device_ip, port, ipaddr, version, device_name, port_name, platform) VALUES (_sip_, _port_, _dip_, _ver_, _name_, _pname_, _plat_); RETURN; END; $$ LANGUAGE plpgsql; DROP FUNCTION public.update_cdp_info(_sip_ inet, _port_ integer, _dip_ inet, _ver_ text, _name_ text, _pname_ text, _plat_ text); publicbeaconfalse4545!125517117@update_directory(macaddr, inet, text, double precision, integer)FUNCTIONCREATE FUNCTION update_directory(_mac_ macaddr, _ip_ inet, _pro_ text, _cf_ double precision, _steady_ integer) RETURNS integer AS $$ BEGIN IF (_steady_ = 1) THEN UPDATE profile_directory SET updated = now(), mactext = _mac_::text, profile = _pro_, ipaddr = _ip_, cf = _cf_ WHERE mac = _mac_; IF FOUND THEN RETURN 1; END IF; ELSE UPDATE profile_directory SET mactext = _mac_::text, profile = _pro_, ipaddr = _ip_, cf = _cf_ WHERE mac = _mac_; IF FOUND THEN RETURN 1; END IF; END IF; INSERT INTO profile_directory (mac, ipaddr, profile, cf, mactext) VALUES (_mac_, _ip_, _pro_, _cf_, _mac_::text); RETURN 2; END; $$ LANGUAGE plpgsql; vDROP FUNCTION public.update_directory(_mac_ macaddr, _ip_ inet, _pro_ text, _cf_ double precision, _steady_ integer); publicbeaconfalse4545125517118)update_ip_history(macaddr, inet, integer)FUNCTIONTCREATE FUNCTION update_ip_history(_mac_ macaddr, _ip_ inet, _vlan_ integer) RETURNS void AS $$ BEGIN UPDATE ip_history SET updated = now(), vlan = _vlan_ WHERE ip = _ip_ and mac = _mac_; IF FOUND THEN RETURN; END IF; INSERT INTO ip_history (mac, ip, vlan) VALUES (_mac_, _ip_, _vlan_); RETURN; END; $$ LANGUAGE plpgsql; RDROP FUNCTION public.update_ip_history(_mac_ macaddr, _ip_ inet, _vlan_ integer); publicbeaconfalse45453125517119Cupdate_mac_model(macaddr, text, double precision, boolean, boolean)FUNCTIONCREATE FUNCTION update_mac_model(_mac_ macaddr, _pro_ text, _cf_ double precision, _top_ boolean, _start_ boolean) RETURNS integer AS $$ BEGIN IF (_top_) THEN DELETE FROM mac_model WHERE mac = _mac_; IF (_start_ = 'f') THEN UPDATE asset_tracking SET proTime = now(), profile = _pro_, retired = 'f' WHERE mac = _mac_; IF NOT FOUND THEN INSERT INTO asset_tracking (profile, mac) VALUES (_pro_, _mac_); END IF; ELSE -- Just update during the restart/remodel. We should be feeding from asset_tracking -- and we'd need more logic to prevent INSERTing when it already exists. UPDATE asset_tracking SET proTime = now(), profile = _pro_ WHERE mac = _mac_ and (profile != _pro_ or profile IS NULL); END IF; END IF; INSERT INTO mac_model (mac, profile, cf, top) VALUES (_mac_, _pro_, _cf_, _top_); RETURN 0; END; $$ LANGUAGE plpgsql; yDROP FUNCTION public.update_mac_model(_mac_ macaddr, _pro_ text, _cf_ double precision, _top_ boolean, _start_ boolean); publicbeaconfalse4545125517120wupdate_port(inet, integer, macaddr, text, text, text, text, text, text, text, integer, text, integer, text, text, text)FUNCTIONwCREATE FUNCTION update_port(_ip_ inet, _port_ integer, _mac_ macaddr, _descr_ text, _media_ text, _speed_ text, _admin_ text, _link_ text, _astate_ text, _actrl_ text, _vid_ integer, _name_ text, _altport_ integer, _auser_ text, _role_ text, _arole_ text) RETURNS integer AS $$ BEGIN UPDATE network_port SET mac = _mac_, description = _descr_, media_type = _media_, speed = _speed_, admin_state = _admin_, link_state = _link_, auth_state = _astate_, auth_control = _actrl_, vid = _vid_, port_name = _name_, alt_port = _altport_, auth_user = _auser_, ets_role = _role_, ets_arole = _arole_, updated = now() WHERE device_ip = _ip_ and port = _port_; IF FOUND THEN RETURN 1; END IF; INSERT INTO network_port (device_ip, port, mac, description, media_type, speed, admin_state, link_state, auth_state, auth_control, vid, port_name, alt_port, auth_user, ets_role, ets_arole) VALUES (_ip_, _port_, _mac_, _descr_, _media_, _speed_, _admin_, _link_, _astate_, _actrl_, _vid_, _name_, _altport_, _auser_, _role_, _arole_); RETURN 0; END; $$ LANGUAGE plpgsql; DROP FUNCTION public.update_port(_ip_ inet, _port_ integer, _mac_ macaddr, _descr_ text, _media_ text, _speed_ text, _admin_ text, _link_ text, _astate_ text, _actrl_ text, _vid_ integer, _name_ text, _altport_ integer, _auser_ text, _role_ text, _arole_ text); publicbeaconfalse4545125517121%update_trunk_cdp(inet, integer, inet)FUNCTIONCREATE FUNCTION update_trunk_cdp(_sip_ inet, _port_ integer, _dip_ inet) RETURNS void AS $$ BEGIN UPDATE trunk_ports SET alt_ip = _dip_, method = '1', updated = now() WHERE device_ip = _sip_ and port = _port_; IF FOUND THEN RETURN; END IF; INSERT INTO trunk_ports (device_ip, alt_ip, port, method) VALUES (_sip_, _dip_, _port_, '1'); RETURN; END; $$ LANGUAGE plpgsql; ODROP FUNCTION public.update_trunk_cdp(_sip_ inet, _port_ integer, _dip_ inet); publicbeaconfalse45450125517122update_trunk_ports(inet)FUNCTIONCREATE FUNCTION update_trunk_ports(_sip_ inet) RETURNS void AS $$ DECLARE trunkTable record; BEGIN FOR trunkTable IN SELECT DISTINCT port_connection.device_ip, port_connection.port FROM port_connection, network_port WHERE port_connection.mac = network_port.mac AND port_connection.device_ip = _sip_ AND port_connection.port IS NOT NULL AND port_connection.device_ip != network_port.device_ip LOOP UPDATE trunk_ports SET method = '0', updated = now() WHERE device_ip = trunkTable.device_ip AND port = trunkTable.port AND alt_ip IS NULL; IF NOT FOUND THEN UPDATE trunk_ports SET updated = now() WHERE device_ip = trunkTable.device_ip AND port = trunkTable.port; IF NOT FOUND THEN INSERT INTO trunk_ports (device_ip, port, method) VALUES (trunkTable.device_ip,trunkTable.port,'0'); END IF; END IF; END LOOP; DELETE FROM trunk_ports WHERE (method = '0' OR method IS NULL) AND device_ip = _sip_ and updated < (now() - (30 * interval '1 minute')); RETURN; END; $$ LANGUAGE plpgsql; 5DROP FUNCTION public.update_trunk_ports(_sip_ inet); publicbeaconfalse45457125517123verify_trap(inet, integer)FUNCTION?CREATE FUNCTION verify_trap(_ip_ inet, _port_ integer) RETURNS integer AS $$ BEGIN IF (SELECT 1 FROM network_device WHERE ipaddr = _ip_ AND (_ip_, _port_) NOT IN (SELECT device_ip, port FROM trunk_ports) LIMIT 1) THEN RETURN 1; ELSE RETURN 0; END IF; RETURN 0; END; $$ LANGUAGE plpgsql; =DROP FUNCTION public.verify_trap(_ip_ inet, _port_ integer); publicbeaconfalse4545m125917126 active_scanTABLECREATE TABLE active_scan ( serial_id serial NOT NULL, ipaddr inet, active boolean, pingable boolean, tcp_ping boolean, last_scan timestamp without time zone DEFAULT now(), first_scan timestamp without time zone DEFAULT now() ); DROP TABLE public.active_scan; publicbeaconfalse182618275z00active_scan_serial_id_seq SEQUENCE SETbSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('active_scan', 'serial_id'), 1, true); publicbeaconfalse1388o125917133adv_ruleTABLECREATE TABLE adv_rule ( xml text, cf integer, rule_id integer, active boolean, serial_id serial NOT NULL ); DROP TABLE public.adv_rule; publicbeaconfalse5{00adv_rule_serial_id_seq SEQUENCE SET`SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('adv_rule', 'serial_id'), 1, false); publicbeaconfalse1390q125917141application_ruleTABLECREATE TABLE application_rule ( banner text, app_type integer, cf integer, rule_id integer, active boolean, serial_id serial NOT NULL ); $DROP TABLE public.application_rule; publicbeaconfalse5|00application_rule_serial_id_seq SEQUENCE SEThSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('application_rule', 'serial_id'), 45, true); publicbeaconfalse1392r125917147 arp_tableTABLECREATE TABLE arp_table ( ip inet, mac macaddr NOT NULL, vlan integer, fromarp boolean, knownrouter boolean, updated timestamp without time zone DEFAULT now() ); DROP TABLE public.arp_table; publicbeaconfalse18305s125917150asset_trackingTABLE"CREATE TABLE asset_tracking ( mac macaddr NOT NULL, is_nat boolean, retired boolean, retiredat timestamp without time zone DEFAULT now(), ipaddr inet, arptime timestamp without time zone DEFAULT now(), device inet, port integer, loctime timestamp without time zone DEFAULT now(), profile text, protime timestamp without time zone DEFAULT now(), authorized boolean, authtime timestamp without time zone DEFAULT now(), addmac boolean, created timestamp without time zone DEFAULT now() ); "DROP TABLE public.asset_tracking; publicbeaconfalse1831183218331834183518365u125917163auth_user_historyTABLECREATE TABLE auth_user_history ( serial_id serial NOT NULL, device_ip inet, port integer, port_name text, auth_user text, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); %DROP TABLE public.auth_user_history; publicbeaconfalse183818395}00auth_user_history_serial_id_seq SEQUENCE SETiSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('auth_user_history', 'serial_id'), 24, true); publicbeaconfalse1396w125917173beacon_commandTABLEtCREATE TABLE beacon_command ( name text, xml text, command_type integer, command serial NOT NULL ); "DROP TABLE public.beacon_command; publicbeaconfalse5~00beacon_command_command_seq SEQUENCE SETdSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('beacon_command', 'command'), 16, true); publicbeaconfalse1398y125917181beacon_command_logTABLECREATE TABLE beacon_command_log ( name text, xml text, username text, settime timestamp without time zone DEFAULT now(), command serial NOT NULL ); &DROP TABLE public.beacon_command_log; publicbeaconfalse1841500beacon_command_log_command_seq SEQUENCE SEThSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('beacon_command_log', 'command'), 1, false); publicbeaconfalse1400{125917190beacon_componentTABLEICREATE TABLE beacon_component ( name text NOT NULL, ipaddr inet, agenttype integer, config_index serial NOT NULL, mw_index integer, ignore boolean, updated timestamp without time zone DEFAULT now(), version text, collector text, status text, status_time timestamp without time zone ); $DROP TABLE public.beacon_component; publicbeaconfalse1844500!beacon_component_config_index_seq SEQUENCE SETjSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('beacon_component', 'config_index'), 7, true); publicbeaconfalse1402}125917199 beacon_eventsTABLECREATE TABLE beacon_events ( serial_id serial NOT NULL, prev_mac macaddr, curr_mac macaddr, prev_model text, curr_model text, prev_user boolean, curr_user boolean, switch_ip inet, port integer, auth_state integer, severity integer, event_type integer, visible boolean, name text, event_time timestamp without time zone DEFAULT now() ); !DROP TABLE public.beacon_events; publicbeaconfalse1846500beacon_events_serial_id_seq SEQUENCE SETeSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('beacon_events', 'serial_id'), 1, false); publicbeaconfalse1404125917802beacon_versionTABLEXCREATE TABLE beacon_version ( serial_id serial NOT NULL, version_number text ); "DROP TABLE public.beacon_version; publicbeaconfalse500beacon_version_serial_id_seq SEQUENCE SETeSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('beacon_version', 'serial_id'), 3, true); publicbeaconfalse1502125917216cca_event_ruleTABLE CREATE TABLE cca_event_rule ( serial_id serial NOT NULL, name text NOT NULL, device_filter integer, check_opt boolean, additions_only boolean, beacon_model text, cca_model text, cf integer, event_level integer, enabled text ); "DROP TABLE public.cca_event_rule; publicbeaconfalse500cca_event_rule_serial_id_seq SEQUENCE SETeSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('cca_event_rule', 'serial_id'), 3, true); publicbeaconfalse1406125917222 cca_rolesTABLEXCREATE TABLE cca_roles ( "role" text NOT NULL, config_index integer NOT NULL ); DROP TABLE public.cca_roles; publicbeaconfalse5125917227 cidr_blocksTABLE}CREATE TABLE cidr_blocks ( config_type integer NOT NULL, config_index integer NOT NULL, ip_cidr inet NOT NULL ); DROP TABLE public.cidr_blocks; publicbeaconfalse5125917229common_port_namesTABLElCREATE TABLE common_port_names ( port integer NOT NULL, protocol integer NOT NULL, name text ); %DROP TABLE public.common_port_names; publicbeaconfalse5125917234device_addr_translationTABLEbCREATE TABLE device_addr_translation ( actual_ip inet NOT NULL, known_ip inet NOT NULL ); +DROP TABLE public.device_addr_translation; publicbeaconfalse5125917238 device_groupsTABLE}CREATE TABLE device_groups ( serial_id serial NOT NULL, group_name text NOT NULL, access_type integer, pass1 text, pass2 text, pass3 text, seclevel text, hashtype text, encrypttype text, mapping_interval integer, layer integer, mapping_agent text, default_vlan integer, auth_vlan integer, wr_mem boolean, xml text ); !DROP TABLE public.device_groups; publicbeaconfalse500device_groups_serial_id_seq SEQUENCE SETdSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('device_groups', 'serial_id'), 3, true); publicbeaconfalse1412125917244 device_roleTABLErCREATE TABLE device_role ( device_id integer NOT NULL, single boolean NOT NULL, name text NOT NULL ); DROP TABLE public.device_role; publicbeaconfalse5125917249 device_vlanTABLECREATE TABLE device_vlan ( device_id integer NOT NULL, single boolean NOT NULL, name text, vlan integer NOT NULL ); DROP TABLE public.device_vlan; publicbeaconfalse5125917254 ets_ct_aliasTABLECREATE TABLE ets_ct_alias ( device_ip inet NOT NULL, port integer NOT NULL, nbt text, mac macaddr, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); DROP TABLE public.ets_ct_alias; publicbeaconfalse184918505125917263eventTABLEBCREATE TABLE event ( serial_id serial NOT NULL, name text NOT NULL, event_type integer, valid_profile text, force_auth boolean, snmp boolean, web boolean, syslog boolean, smtp boolean, asm boolean, link boolean, preport boolean, event_level integer, enabled text ); DROP TABLE public.event; publicbeaconfalse500event_serial_id_seq SEQUENCE SET\SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('event', 'serial_id'), 2, true); publicbeaconfalse1417125917269forwarder_configTABLEKCREATE TABLE forwarder_config ( name text NOT NULL, ipaddr inet ); $DROP TABLE public.forwarder_config; publicbeaconfalse5125917276 generic_tableTABLE#CREATE TABLE generic_table ( serial_id serial NOT NULL, ipaddr inet, text1 text, text2 text, text3 text, int1 integer, int2 integer, int3 integer, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); !DROP TABLE public.generic_table; publicbeaconfalse18531854500generic_table_serial_id_seq SEQUENCE SETeSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('generic_table', 'serial_id'), 1, false); publicbeaconfalse1420125917284 inquire_netsTABLE_CREATE TABLE inquire_nets ( addr_block inet NOT NULL, config_index integer NOT NULL ); DROP TABLE public.inquire_nets; publicbeaconfalse5125917780 integrationTABLECREATE TABLE integration ( serial_id serial NOT NULL, "type" integer, "action" integer, mac macaddr, config text, created timestamp without time zone DEFAULT now() ); DROP TABLE public.integration; publicbeaconfalse1919500integration_serial_id_seq SEQUENCE SETcSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('integration', 'serial_id'), 97, true); publicbeaconfalse1498125917297 ip_historyTABLECREATE TABLE ip_history ( serial_id serial NOT NULL, mac macaddr, ip inet, vlan integer, updated timestamp without time zone DEFAULT now() ); DROP TABLE public.ip_history; publicbeaconfalse1856500ip_history_serial_id_seq SEQUENCE SETbSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('ip_history', 'serial_id'), 62, true); publicbeaconfalse1423125917303ip_modelTABLECREATE TABLE ip_model ( serial_id serial NOT NULL, ipaddr inet, profile text, cf double precision, manual boolean, top boolean, model_time timestamp without time zone DEFAULT now() ); DROP TABLE public.ip_model; publicbeaconfalse18585125917312ip_model_historicalTABLECREATE TABLE ip_model_historical ( serial_id serial NOT NULL, ipaddr inet, profile text, cf double precision, updated timestamp without time zone DEFAULT now(), model_time timestamp without time zone DEFAULT now() ); 'DROP TABLE public.ip_model_historical; publicbeaconfalse18601861500!ip_model_historical_serial_id_seq SEQUENCE SETkSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('ip_model_historical', 'serial_id'), 18, true); publicbeaconfalse142700ip_model_serial_id_seq SEQUENCE SETaSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('ip_model', 'serial_id'), 139, true); publicbeaconfalse1425125917322ip_ruleTABLECREATE TABLE ip_rule ( ipaddr inet, mask inet, cf integer, rule_id integer, active boolean, serial_id serial NOT NULL ); DROP TABLE public.ip_rule; publicbeaconfalse500ip_rule_serial_id_seq SEQUENCE SET^SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('ip_rule', 'serial_id'), 2, true); publicbeaconfalse1429125917327 mac_historyTABLECREATE TABLE mac_history ( serial_id serial NOT NULL, mac macaddr, device_ip inet, port integer, removed boolean, removedat timestamp without time zone, updated timestamp without time zone DEFAULT now() ); DROP TABLE public.mac_history; publicbeaconfalse1864500mac_history_serial_id_seq SEQUENCE SETdSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('mac_history', 'serial_id'), 825, true); publicbeaconfalse1431125917333 mac_modelTABLECREATE TABLE mac_model ( serial_id serial NOT NULL, mac macaddr, ipaddr inet, profile text, cf double precision, manual boolean, top boolean, model_time timestamp without time zone DEFAULT now() ); DROP TABLE public.mac_model; publicbeaconfalse18665125917342mac_model_historicalTABLECREATE TABLE mac_model_historical ( serial_id serial NOT NULL, mac macaddr, ipaddr inet, profile text, cf double precision, updated timestamp without time zone DEFAULT now(), model_time timestamp without time zone DEFAULT now() ); (DROP TABLE public.mac_model_historical; publicbeaconfalse18681869500"mac_model_historical_serial_id_seq SEQUENCE SETmSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('mac_model_historical', 'serial_id'), 347, true); publicbeaconfalse143500mac_model_serial_id_seq SEQUENCE SETcSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('mac_model', 'serial_id'), 4742, true); publicbeaconfalse1433125917352mac_ruleTABLECREATE TABLE mac_rule ( vendor text, cf integer, rule_id integer, active boolean, serial_id serial NOT NULL ); DROP TABLE public.mac_rule; publicbeaconfalse500mac_rule_serial_id_seq SEQUENCE SET_SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('mac_rule', 'serial_id'), 4, true); publicbeaconfalse1437125917791managable_devicesTABLEYCREATE TABLE managable_devices ( ipaddr inet, pass1 text, pass2 text, pass3 text, seclevel text, hashtype text, encrypttype text, sysname text, sysdesc text, "location" text, contact text, managed boolean, serial_id serial NOT NULL, discovered timestamp without time zone DEFAULT now() ); %DROP TABLE public.managable_devices; publicbeaconfalse1921500managable_devices_serial_id_seq SEQUENCE SETiSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('managable_devices', 'serial_id'), 1, false); publicbeaconfalse1500125917369middleware_configTABLECREATE TABLE middleware_config ( serial_id serial NOT NULL, local_ip inet, remote_ip inet, domain_name text, encrypt_type integer, port integer, shared_secret text, is_server boolean, agent_name text ); %DROP TABLE public.middleware_config; publicbeaconfalse500middleware_config_serial_id_seq SEQUENCE SEThSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('middleware_config', 'serial_id'), 3, true); publicbeaconfalse1439125917377 nac_tableTABLECREATE TABLE nac_table ( serial_id serial NOT NULL, platform_regex text, supervisor_regex text, os_regex text, platform text, supervisor text, os text, nac_l2_x text, nac_l2_ip text, nac_l3 text, nac_agentless text ); DROP TABLE public.nac_table; publicbeaconfalse500nac_table_serial_id_seq SEQUENCE SETaSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('nac_table', 'serial_id'), 13, true); publicbeaconfalse1441125917385net_ruleTABLECREATE TABLE net_rule ( ipaddr inet, source boolean, sport integer, dport integer, cf integer, rule_id integer, active boolean, serial_id serial NOT NULL ); DROP TABLE public.net_rule; publicbeaconfalse500net_rule_serial_id_seq SEQUENCE SET`SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('net_rule', 'serial_id'), 1, false); publicbeaconfalse1443125917390 netdev_eventsTABLECREATE TABLE netdev_events ( serial_id serial NOT NULL, netdev_id integer, event_id integer, filter text, isgroup boolean, active boolean ); !DROP TABLE public.netdev_events; publicbeaconfalse500netdev_events_serial_id_seq SEQUENCE SETeSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('netdev_events', 'serial_id'), 1, false); publicbeaconfalse1445125917396 netflow_netsTABLE_CREATE TABLE netflow_nets ( addr_block inet NOT NULL, config_index integer NOT NULL ); DROP TABLE public.netflow_nets; publicbeaconfalse5125917398netinquiry_configTABLECREATE TABLE netinquiry_config ( pol_index integer NOT NULL, num_workers integer, ping_sweep boolean, dns_query boolean, frequency integer ); %DROP TABLE public.netinquiry_config; publicbeaconfalse5125917400 netmap_configTABLEkCREATE TABLE netmap_config ( pol_index integer NOT NULL, num_workers integer, delay integer ); !DROP TABLE public.netmap_config; publicbeaconfalse5125917404netport_eventsTABLECREATE TABLE netport_events ( serial_id serial NOT NULL, device_ip inet, port integer, event_id integer, active boolean ); "DROP TABLE public.netport_events; publicbeaconfalse500netport_events_serial_id_seq SEQUENCE SETfSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('netport_events', 'serial_id'), 1, false); publicbeaconfalse1450125917407netrelay_configTABLEgCREATE TABLE netrelay_config ( pol_index integer NOT NULL, nf_net text, netflow boolean ); #DROP TABLE public.netrelay_config; publicbeaconfalse5125917412nettrap_configTABLElCREATE TABLE nettrap_config ( pol_index integer, ipaddr inet NOT NULL, port integer NOT NULL ); "DROP TABLE public.nettrap_config; publicbeaconfalse5125917416netwatch_configTABLECREATE TABLE netwatch_config ( pol_serial serial NOT NULL, pol_index integer NOT NULL, network text, interface text NOT NULL, filter text ); #DROP TABLE public.netwatch_config; publicbeaconfalse500netwatch_config_pol_serial_seq SEQUENCE SETgSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('netwatch_config', 'pol_serial'), 2, true); publicbeaconfalse1454125917424networkTABLEWCREATE TABLE network ( org_name text NOT NULL, config_index serial NOT NULL ); DROP TABLE public.network; publicbeaconfalse500network_config_index_seq SEQUENCE SETaSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('network', 'config_index'), 1, true); publicbeaconfalse1456125917432network_deviceTABLECREATE TABLE network_device ( serial_id serial NOT NULL, ipaddr inet NOT NULL, name text, sysdesc text, "location" text, contact text, access_type integer, pass1 text, pass2 text, pass3 text, seclevel text, hashtype text, encrypttype text, mapping_agent text, mapping_interval integer, layer integer, group_name text, xml text, default_vlan integer, auth_vlan integer, trunk_ports text, wr_mem boolean, chassis text, modules text, pae_present boolean, dot1x_enabled boolean, radius_configured text, scan_status text, scan_time timestamp without time zone, updated timestamp without time zone DEFAULT now() ); "DROP TABLE public.network_device; publicbeaconfalse1879500network_device_serial_id_seq SEQUENCE SETfSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('network_device', 'serial_id'), 19, true); publicbeaconfalse1458125917439network_neighborTABLECREATE TABLE network_neighbor ( device_ip inet NOT NULL, port integer NOT NULL, ipaddr inet, version text, device_name text, port_name text, platform text, updated timestamp without time zone DEFAULT now() ); $DROP TABLE public.network_neighbor; publicbeaconfalse18805125917445 network_portTABLECREATE TABLE network_port ( device_ip inet NOT NULL, port integer NOT NULL, mac macaddr, description text, link_state text, admin_state text, media_type text, speed text, auth_state text, auth_control text, auth_user text, port_name text, vid integer, alt_port integer, is_trunk boolean, ets_role text, ets_arole text, updated timestamp without time zone DEFAULT now() ); DROP TABLE public.network_port; publicbeaconfalse18815125917451 node_activeTABLECREATE TABLE node_active ( ip inet NOT NULL, protocol integer, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); DROP TABLE public.node_active; publicbeaconfalse188218835125917457 node_dataTABLECREATE TABLE node_data ( serial_id serial NOT NULL, ip inet, mac macaddr, match_name text, data text, data_type integer, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); DROP TABLE public.node_data; publicbeaconfalse18851886500node_data_serial_id_seq SEQUENCE SETcSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('node_data', 'serial_id'), 3053, true); publicbeaconfalse1463125917465 node_nameTABLECREATE TABLE node_name ( ip inet NOT NULL, dns text, nbt text, username text, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); DROP TABLE public.node_name; publicbeaconfalse188718885125917474 node_softwareTABLEQCREATE TABLE node_software ( serial_id serial NOT NULL, ip inet, mac macaddr, protocol integer, port integer, description text, data text, version text, server boolean, active boolean, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); !DROP TABLE public.node_software; publicbeaconfalse18901891500node_software_serial_id_seq SEQUENCE SETdSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('node_software', 'serial_id'), 2, true); publicbeaconfalse1466125917484 node_stackTABLE/CREATE TABLE node_stack ( serial_id serial NOT NULL, ip inet, mac macaddr, df boolean, ttl integer, mss integer, window integer, scale integer, list text, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); DROP TABLE public.node_stack; publicbeaconfalse18931894500node_stack_serial_id_seq SEQUENCE SETbSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('node_stack', 'serial_id'), 1, false); publicbeaconfalse1468125917494 node_trafficTABLECREATE TABLE node_traffic ( serial_id serial NOT NULL, ip inet, alt_ip inet, sport integer, dport integer, protocol integer, server boolean, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); DROP TABLE public.node_traffic; publicbeaconfalse18961897500node_traffic_serial_id_seq SEQUENCE SETdSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('node_traffic', 'serial_id'), 1, false); publicbeaconfalse1470125917499oui_refTABLECCREATE TABLE oui_ref ( mac macaddr NOT NULL, manuf text ); DROP TABLE public.oui_ref; publicbeaconfalse5125917504port_connectionTABLECREATE TABLE port_connection ( device_ip inet NOT NULL, port integer, mac macaddr NOT NULL, router inet, updated timestamp without time zone DEFAULT now() ); #DROP TABLE public.port_connection; publicbeaconfalse18985125917509 port_ruleTABLECREATE TABLE port_rule ( port integer, cf integer, rule_id integer, active boolean, serial_id serial NOT NULL ); DROP TABLE public.port_rule; publicbeaconfalse500port_rule_serial_id_seq SEQUENCE SET`SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('port_rule', 'serial_id'), 1, true); publicbeaconfalse1474125917514profileTABLECREATE TABLE profile ( name text NOT NULL, description text, version text, user_modified boolean, auth_user boolean, enabled boolean, allow_timeout boolean, ldap boolean, serial_id serial NOT NULL ); DROP TABLE public.profile; publicbeaconfalse5125917522 profile_diffTABLECREATE TABLE profile_diff ( serial_id serial NOT NULL, duser text NOT NULL, profile text, total integer, report_time timestamp without time zone DEFAULT now() ); DROP TABLE public.profile_diff; publicbeaconfalse1902500profile_diff_serial_id_seq SEQUENCE SETeSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('profile_diff', 'serial_id'), 835, true); publicbeaconfalse1478125917531profile_directoryTABLE%CREATE TABLE profile_directory ( mac macaddr NOT NULL, ipaddr inet, profile text, cf double precision, manual boolean, id serial NOT NULL, mactext text, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); %DROP TABLE public.profile_directory; publicbeaconfalse190419055125917541profile_directory_historicalTABLE.CREATE TABLE profile_directory_historical ( serial_id serial NOT NULL, mac macaddr, ipaddr inet, profile text, cf double precision, manual boolean, mactext text, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); 0DROP TABLE public.profile_directory_historical; publicbeaconfalse19071908500*profile_directory_historical_serial_id_seq SEQUENCE SETtSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('profile_directory_historical', 'serial_id'), 1, false); publicbeaconfalse148200profile_directory_id_seq SEQUENCE SETcSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('profile_directory', 'id'), 175, true); publicbeaconfalse148000profile_serial_id_seq SEQUENCE SET_SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('profile', 'serial_id'), 41, true); publicbeaconfalse1476125917551 proto_ruleTABLECREATE TABLE proto_rule ( protocol integer, cf integer, rule_id integer, active boolean, serial_id serial NOT NULL ); DROP TABLE public.proto_rule; publicbeaconfalse500proto_rule_serial_id_seq SEQUENCE SETbSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('proto_rule', 'serial_id'), 1, false); publicbeaconfalse1484125917556router_interfacesTABLECREATE TABLE router_interfaces ( serial_id serial NOT NULL, router_index integer, device_ip inet, netmask inet, low inet, high inet ); %DROP TABLE public.router_interfaces; publicbeaconfalse500router_interfaces_serial_id_seq SEQUENCE SETjSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('router_interfaces', 'serial_id'), 468, true); publicbeaconfalse1486125917561server_commandsTABLEjCREATE TABLE server_commands ( command_id serial NOT NULL, command_type integer, data text ); #DROP TABLE public.server_commands; publicbeaconfalse500server_commands_command_id_seq SEQUENCE SEThSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('server_commands', 'command_id'), 1, false); publicbeaconfalse1488125917567 server_configTABLECREATE TABLE server_config ( pol_index integer NOT NULL, nm_interval integer, arp_interval integer, db_interval integer, scan_interval integer, max_scan integer, port_timeout integer, dir_timeout integer, age_interval integer, age_penalty integer, preport_interval integer, version text, snmp_path text, snmp_addr text, snmp_string text, snmp_agent text, asm_ip text, ipaddr inet, ref_addr text, cca_user text, cca_pass text, cca_root text, cca_addr text, cca_ver text, addonly boolean, ccasync boolean, cca_api boolean, cca_log boolean, ldap_auth boolean, ldap_enable boolean, ldap_sync boolean, ldap_verbose boolean ); !DROP TABLE public.server_config; publicbeaconfalse5125917574 stack_ruleTABLECREATE TABLE stack_rule ( df boolean, ttl integer, mss integer, mss_mult integer, window integer, scale integer, list text, cf integer, rule_id integer, active boolean, serial_id serial NOT NULL ); DROP TABLE public.stack_rule; publicbeaconfalse500stack_rule_serial_id_seq SEQUENCE SETbSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('stack_rule', 'serial_id'), 1, false); publicbeaconfalse1491125917582static_profileTABLECREATE TABLE static_profile ( ipaddr inet, mac macaddr, cf integer, rule_id integer, active boolean, serial_id serial NOT NULL ); "DROP TABLE public.static_profile; publicbeaconfalse500static_profile_serial_id_seq SEQUENCE SETfSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('static_profile', 'serial_id'), 1, false); publicbeaconfalse1493125917585 trunk_portsTABLECREATE TABLE trunk_ports ( device_ip inet NOT NULL, alt_ip inet, port integer NOT NULL, method integer, updated timestamp without time zone DEFAULT now() ); DROP TABLE public.trunk_ports; publicbeaconfalse19145125917590 user_accountsTABLECREATE TABLE user_accounts ( name text NOT NULL, "password" text, access_level integer, enabled boolean, serial_id serial NOT NULL, updated timestamp without time zone DEFAULT now(), created timestamp without time zone DEFAULT now() ); !DROP TABLE public.user_accounts; publicbeaconfalse19161917500user_accounts_serial_id_seq SEQUENCE SETdSELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('user_accounts', 'serial_id'), 2, true); publicbeaconfalse14960017126 active_scan TABLE DATAdCOPY active_scan (serial_id, ipaddr, active, pingable, tcp_ping, last_scan, first_scan) FROM stdin; publicbeaconfalse1389L1017133adv_rule TABLE DATA@COPY adv_rule (xml, cf, rule_id, active, serial_id) FROM stdin; publicbeaconfalse13912017141application_rule TABLE DATAUCOPY application_rule (banner, app_type, cf, rule_id, active, serial_id) FROM stdin; publicbeaconfalse13933017147 arp_table TABLE DATAJCOPY arp_table (ip, mac, vlan, fromarp, knownrouter, updated) FROM stdin; publicbeaconfalse139484017150asset_tracking TABLE DATACOPY asset_tracking (mac, is_nat, retired, retiredat, ipaddr, arptime, device, port, loctime, profile, protime, authorized, authtime, addmac, created) FROM stdin; publicbeaconfalse1395E 5017163auth_user_history TABLE DATAhCOPY auth_user_history (serial_id, device_ip, port, port_name, auth_user, updated, created) FROM stdin; publicbeaconfalse1397q*6017173beacon_command TABLE DATACCOPY beacon_command (name, xml, command_type, command) FROM stdin; publicbeaconfalse1399,7017181beacon_command_log TABLE DATALCOPY beacon_command_log (name, xml, username, settime, command) FROM stdin; publicbeaconfalse1401,8017190beacon_component TABLE DATACOPY beacon_component (name, ipaddr, agenttype, config_index, mw_index, ignore, updated, version, collector, status, status_time) FROM stdin; publicbeaconfalse1403-9017199 beacon_events TABLE DATACOPY beacon_events (serial_id, prev_mac, curr_mac, prev_model, curr_model, prev_user, curr_user, switch_ip, port, auth_state, severity, event_type, visible, name, event_time) FROM stdin; publicbeaconfalse1405.u017802beacon_version TABLE DATA<COPY beacon_version (serial_id, version_number) FROM stdin; publicbeaconfalse15037.:017216cca_event_rule TABLE DATACOPY cca_event_rule (serial_id, name, device_filter, check_opt, additions_only, beacon_model, cca_model, cf, event_level, enabled) FROM stdin; publicbeaconfalse1407\.;017222 cca_roles TABLE DATA2COPY cca_roles ("role", config_index) FROM stdin; publicbeaconfalse1408.<017227 cidr_blocks TABLE DATABCOPY cidr_blocks (config_type, config_index, ip_cidr) FROM stdin; publicbeaconfalse1409.=017229common_port_names TABLE DATA:COPY common_port_names (port, protocol, name) FROM stdin; publicbeaconfalse1410+/>017234device_addr_translation TABLE DATA?COPY device_addr_translation (actual_ip, known_ip) FROM stdin; publicbeaconfalse14115?017238 device_groups TABLE DATACOPY device_groups (serial_id, group_name, access_type, pass1, pass2, pass3, seclevel, hashtype, encrypttype, mapping_interval, layer, mapping_agent, default_vlan, auth_vlan, wr_mem, xml) FROM stdin; publicbeaconfalse1413A6@017244 device_role TABLE DATA7COPY device_role (device_id, single, name) FROM stdin; publicbeaconfalse14147A017249 device_vlan TABLE DATA=COPY device_vlan (device_id, single, name, vlan) FROM stdin; publicbeaconfalse141527B017254 ets_ct_alias TABLE DATALCOPY ets_ct_alias (device_ip, port, nbt, mac, updated, created) FROM stdin; publicbeaconfalse1416O7C017263event TABLE DATACOPY event (serial_id, name, event_type, valid_profile, force_auth, snmp, web, syslog, smtp, asm, link, preport, event_level, enabled) FROM stdin; publicbeaconfalse1418l7D017269forwarder_config TABLE DATA1COPY forwarder_config (name, ipaddr) FROM stdin; publicbeaconfalse14197E017276 generic_table TABLE DATAlCOPY generic_table (serial_id, ipaddr, text1, text2, text3, int1, int2, int3, updated, created) FROM stdin; publicbeaconfalse14217F017284 inquire_nets TABLE DATA9COPY inquire_nets (addr_block, config_index) FROM stdin; publicbeaconfalse14228s017780 integration TABLE DATAQCOPY integration (serial_id, "type", "action", mac, config, created) FROM stdin; publicbeaconfalse1499@8G017297 ip_history TABLE DATA@COPY ip_history (serial_id, mac, ip, vlan, updated) FROM stdin; publicbeaconfalse1424]8H017303ip_model TABLE DATATCOPY ip_model (serial_id, ipaddr, profile, cf, manual, top, model_time) FROM stdin; publicbeaconfalse1426h=I017312ip_model_historical TABLE DATA[COPY ip_model_historical (serial_id, ipaddr, profile, cf, updated, model_time) FROM stdin; publicbeaconfalse1428n>J017322ip_rule TABLE DATAHCOPY ip_rule (ipaddr, mask, cf, rule_id, active, serial_id) FROM stdin; publicbeaconfalse1430?K017327 mac_history TABLE DATA\COPY mac_history (serial_id, mac, device_ip, port, removed, removedat, updated) FROM stdin; publicbeaconfalse14324@L017333 mac_model TABLE DATAZCOPY mac_model (serial_id, mac, ipaddr, profile, cf, manual, top, model_time) FROM stdin; publicbeaconfalse1434^iM017342mac_model_historical TABLE DATAaCOPY mac_model_historical (serial_id, mac, ipaddr, profile, cf, updated, model_time) FROM stdin; publicbeaconfalse1436vN017352mac_rule TABLE DATACCOPY mac_rule (vendor, cf, rule_id, active, serial_id) FROM stdin; publicbeaconfalse1438t017791managable_devices TABLE DATACOPY managable_devices (ipaddr, pass1, pass2, pass3, seclevel, hashtype, encrypttype, sysname, sysdesc, "location", contact, managed, serial_id, discovered) FROM stdin; publicbeaconfalse1501O017369middleware_config TABLE DATACOPY middleware_config (serial_id, local_ip, remote_ip, domain_name, encrypt_type, port, shared_secret, is_server, agent_name) FROM stdin; publicbeaconfalse1440P017377 nac_table TABLE DATACOPY nac_table (serial_id, platform_regex, supervisor_regex, os_regex, platform, supervisor, os, nac_l2_x, nac_l2_ip, nac_l3, nac_agentless) FROM stdin; publicbeaconfalse1442 Q017385net_rule TABLE DATAYCOPY net_rule (ipaddr, source, sport, dport, cf, rule_id, active, serial_id) FROM stdin; publicbeaconfalse1444~R017390 netdev_events TABLE DATAYCOPY netdev_events (serial_id, netdev_id, event_id, filter, isgroup, active) FROM stdin; publicbeaconfalse1446S017396 netflow_nets TABLE DATA9COPY netflow_nets (addr_block, config_index) FROM stdin; publicbeaconfalse1447T017398netinquiry_config TABLE DATA^COPY netinquiry_config (pol_index, num_workers, ping_sweep, dns_query, frequency) FROM stdin; publicbeaconfalse1448ՓU017400 netmap_config TABLE DATA?COPY netmap_config (pol_index, num_workers, delay) FROM stdin; publicbeaconfalse1449V017404netport_events TABLE DATAOCOPY netport_events (serial_id, device_ip, port, event_id, active) FROM stdin; publicbeaconfalse1451W017407netrelay_config TABLE DATA>COPY netrelay_config (pol_index, nf_net, netflow) FROM stdin; publicbeaconfalse1452<X017412nettrap_config TABLE DATA:COPY nettrap_config (pol_index, ipaddr, port) FROM stdin; publicbeaconfalse1453^Y017416netwatch_config TABLE DATAUCOPY netwatch_config (pol_serial, pol_index, network, interface, filter) FROM stdin; publicbeaconfalse1455{Z017424network TABLE DATA2COPY network (org_name, config_index) FROM stdin; publicbeaconfalse1457[017432network_device TABLE DATAdCOPY network_device (serial_id, ipaddr, name, sysdesc, "location", contact, access_type, pass1, pass2, pass3, seclevel, hashtype, encrypttype, mapping_agent, mapping_interval, layer, group_name, xml, default_vlan, auth_vlan, trunk_ports, wr_mem, chassis, modules, pae_present, dot1x_enabled, radius_configured, scan_status, scan_time, updated) FROM stdin; publicbeaconfalse1459\017439network_neighbor TABLE DATApCOPY network_neighbor (device_ip, port, ipaddr, version, device_name, port_name, platform, updated) FROM stdin; publicbeaconfalse14609]017445 network_port TABLE DATACOPY network_port (device_ip, port, mac, description, link_state, admin_state, media_type, speed, auth_state, auth_control, auth_user, port_name, vid, alt_port, is_trunk, ets_role, ets_arole, updated) FROM stdin; publicbeaconfalse1461_^017451 node_active TABLE DATA>COPY node_active (ip, protocol, updated, created) FROM stdin; publicbeaconfalse1462_017457 node_data TABLE DATA_COPY node_data (serial_id, ip, mac, match_name, data, data_type, updated, created) FROM stdin; publicbeaconfalse1464;`017465 node_name TABLE DATAFCOPY node_name (ip, dns, nbt, username, updated, created) FROM stdin; publicbeaconfalse1465|a017474 node_software TABLE DATACOPY node_software (serial_id, ip, mac, protocol, port, description, data, version, server, active, updated, created) FROM stdin; publicbeaconfalse1467b017484 node_stack TABLE DATAfCOPY node_stack (serial_id, ip, mac, df, ttl, mss, window, scale, list, updated, created) FROM stdin; publicbeaconfalse1469c017494 node_traffic TABLE DATAhCOPY node_traffic (serial_id, ip, alt_ip, sport, dport, protocol, server, updated, created) FROM stdin; publicbeaconfalse1471d017499oui_ref TABLE DATA&COPY oui_ref (mac, manuf) FROM stdin; publicbeaconfalse14723e017504port_connection TABLE DATAICOPY port_connection (device_ip, port, mac, router, updated) FROM stdin; publicbeaconfalse1473&f017509 port_rule TABLE DATABCOPY port_rule (port, cf, rule_id, active, serial_id) FROM stdin; publicbeaconfalse1475 g017514profile TABLE DATAyCOPY profile (name, description, version, user_modified, auth_user, enabled, allow_timeout, ldap, serial_id) FROM stdin; publicbeaconfalse14779h017522 profile_diff TABLE DATANCOPY profile_diff (serial_id, duser, profile, total, report_time) FROM stdin; publicbeaconfalse1479wi017531profile_directory TABLE DATAeCOPY profile_directory (mac, ipaddr, profile, cf, manual, id, mactext, updated, created) FROM stdin; publicbeaconfalse1481j017541profile_directory_historical TABLE DATAwCOPY profile_directory_historical (serial_id, mac, ipaddr, profile, cf, manual, mactext, updated, created) FROM stdin; publicbeaconfalse1483; k017551 proto_rule TABLE DATAGCOPY proto_rule (protocol, cf, rule_id, active, serial_id) FROM stdin; publicbeaconfalse1485X l017556router_interfaces TABLE DATA\COPY router_interfaces (serial_id, router_index, device_ip, netmask, low, high) FROM stdin; publicbeaconfalse1487u m017561server_commands TABLE DATABCOPY server_commands (command_id, command_type, data) FROM stdin; publicbeaconfalse1489 n017567 server_config TABLE DATACOPY server_config (pol_index, nm_interval, arp_interval, db_interval, scan_interval, max_scan, port_timeout, dir_timeout, age_interval, age_penalty, preport_interval, version, snmp_path, snmp_addr, snmp_string, snmp_agent, asm_ip, ipaddr, ref_addr, cca_user, cca_pass, cca_root, cca_addr, cca_ver, addonly, ccasync, cca_api, cca_log, ldap_auth, ldap_enable, ldap_sync, ldap_verbose) FROM stdin; publicbeaconfalse14907 o017574 stack_rule TABLE DATAjCOPY stack_rule (df, ttl, mss, mss_mult, window, scale, list, cf, rule_id, active, serial_id) FROM stdin; publicbeaconfalse1492 p017582static_profile TABLE DATANCOPY static_profile (ipaddr, mac, cf, rule_id, active, serial_id) FROM stdin; publicbeaconfalse1494 q017585 trunk_ports TABLE DATAHCOPY trunk_ports (device_ip, alt_ip, port, method, updated) FROM stdin; publicbeaconfalse1495 r017590 user_accounts TABLE DATAfCOPY user_accounts (name, "password", access_level, enabled, serial_id, updated, created) FROM stdin; publicbeaconfalse1497 260617599active_scan_pkey CONSTRAINTZALTER TABLE ONLY active_scan ADD CONSTRAINT active_scan_pkey PRIMARY KEY (serial_id); FALTER TABLE ONLY public.active_scan DROP CONSTRAINT active_scan_pkey; publicbeaconfalse13891389260617601 adv_rule_pkey CONSTRAINTTALTER TABLE ONLY adv_rule ADD CONSTRAINT adv_rule_pkey PRIMARY KEY (serial_id); @ALTER TABLE ONLY public.adv_rule DROP CONSTRAINT adv_rule_pkey; publicbeaconfalse13911391260617603application_rule_pkey CONSTRAINTdALTER TABLE ONLY application_rule ADD CONSTRAINT application_rule_pkey PRIMARY KEY (serial_id); PALTER TABLE ONLY public.application_rule DROP CONSTRAINT application_rule_pkey; publicbeaconfalse13931393260617605arp_table_pkey CONSTRAINTPALTER TABLE ONLY arp_table ADD CONSTRAINT arp_table_pkey PRIMARY KEY (mac); BALTER TABLE ONLY public.arp_table DROP CONSTRAINT arp_table_pkey; publicbeaconfalse13941394260617607asset_tracking_pkey CONSTRAINTZALTER TABLE ONLY asset_tracking ADD CONSTRAINT asset_tracking_pkey PRIMARY KEY (mac); LALTER TABLE ONLY public.asset_tracking DROP CONSTRAINT asset_tracking_pkey; publicbeaconfalse13951395260617609auth_user_history_pkey CONSTRAINTfALTER TABLE ONLY auth_user_history ADD CONSTRAINT auth_user_history_pkey PRIMARY KEY (serial_id); RALTER TABLE ONLY public.auth_user_history DROP CONSTRAINT auth_user_history_pkey; publicbeaconfalse13971397260617611beacon_command_log_pkey CONSTRAINTfALTER TABLE ONLY beacon_command_log ADD CONSTRAINT beacon_command_log_pkey PRIMARY KEY (command); TALTER TABLE ONLY public.beacon_command_log DROP CONSTRAINT beacon_command_log_pkey; publicbeaconfalse14011401260617613beacon_command_pkey CONSTRAINT^ALTER TABLE ONLY beacon_command ADD CONSTRAINT beacon_command_pkey PRIMARY KEY (command); LALTER TABLE ONLY public.beacon_command DROP CONSTRAINT beacon_command_pkey; publicbeaconfalse13991399260617615beacon_component_pkey CONSTRAINT_ALTER TABLE ONLY beacon_component ADD CONSTRAINT beacon_component_pkey PRIMARY KEY (name); PALTER TABLE ONLY public.beacon_component DROP CONSTRAINT beacon_component_pkey; publicbeaconfalse14031403260617617beacon_events_pkey CONSTRAINT^ALTER TABLE ONLY beacon_events ADD CONSTRAINT beacon_events_pkey PRIMARY KEY (serial_id); JALTER TABLE ONLY public.beacon_events DROP CONSTRAINT beacon_events_pkey; publicbeaconfalse14051405/260617809beacon_version_pkey CONSTRAINT`ALTER TABLE ONLY beacon_version ADD CONSTRAINT beacon_version_pkey PRIMARY KEY (serial_id); LALTER TABLE ONLY public.beacon_version DROP CONSTRAINT beacon_version_pkey; publicbeaconfalse15031503260617621cca_event_rule_pkey CONSTRAINT[ALTER TABLE ONLY cca_event_rule ADD CONSTRAINT cca_event_rule_pkey PRIMARY KEY (name); LALTER TABLE ONLY public.cca_event_rule DROP CONSTRAINT cca_event_rule_pkey; publicbeaconfalse14071407260617623cca_roles_pkey CONSTRAINTaALTER TABLE ONLY cca_roles ADD CONSTRAINT cca_roles_pkey PRIMARY KEY (config_index, "role"); BALTER TABLE ONLY public.cca_roles DROP CONSTRAINT cca_roles_pkey; publicbeaconfalse140814081408260617625cidr_blocks_pkey CONSTRAINTsALTER TABLE ONLY cidr_blocks ADD CONSTRAINT cidr_blocks_pkey PRIMARY KEY (config_type, config_index, ip_cidr); FALTER TABLE ONLY public.cidr_blocks DROP CONSTRAINT cidr_blocks_pkey; publicbeaconfalse1409140914091409260617627common_port_names_pkey CONSTRAINTkALTER TABLE ONLY common_port_names ADD CONSTRAINT common_port_names_pkey PRIMARY KEY (port, protocol); RALTER TABLE ONLY public.common_port_names DROP CONSTRAINT common_port_names_pkey; publicbeaconfalse141014101410260617629device_addr_translation_pkey CONSTRAINT|ALTER TABLE ONLY device_addr_translation ADD CONSTRAINT device_addr_translation_pkey PRIMARY KEY (actual_ip, known_ip); ^ALTER TABLE ONLY public.device_addr_translation DROP CONSTRAINT device_addr_translation_pkey; publicbeaconfalse141114111411260617631device_groups_pkey CONSTRAINT_ALTER TABLE ONLY device_groups ADD CONSTRAINT device_groups_pkey PRIMARY KEY (group_name); JALTER TABLE ONLY public.device_groups DROP CONSTRAINT device_groups_pkey; publicbeaconfalse14131413260617776device_role_pkey CONSTRAINThALTER TABLE ONLY device_role ADD CONSTRAINT device_role_pkey PRIMARY KEY (device_id, name, single); FALTER TABLE ONLY public.device_role DROP CONSTRAINT device_role_pkey; publicbeaconfalse1414141414141414260617774device_vlan_pkey CONSTRAINThALTER TABLE ONLY device_vlan ADD CONSTRAINT device_vlan_pkey PRIMARY KEY (device_id, vlan, single); FALTER TABLE ONLY public.device_vlan DROP CONSTRAINT device_vlan_pkey; publicbeaconfalse1415141514151415260617637ets_ct_alias_pkey CONSTRAINTbALTER TABLE ONLY ets_ct_alias ADD CONSTRAINT ets_ct_alias_pkey PRIMARY KEY (device_ip, port); HALTER TABLE ONLY public.ets_ct_alias DROP CONSTRAINT ets_ct_alias_pkey; publicbeaconfalse141614161416260617639 event_pkey CONSTRAINTIALTER TABLE ONLY event ADD CONSTRAINT event_pkey PRIMARY KEY (name); :ALTER TABLE ONLY public.event DROP CONSTRAINT event_pkey; publicbeaconfalse14181418260617641forwarder_config_pkey CONSTRAINT_ALTER TABLE ONLY forwarder_config ADD CONSTRAINT forwarder_config_pkey PRIMARY KEY (name); PALTER TABLE ONLY public.forwarder_config DROP CONSTRAINT forwarder_config_pkey; publicbeaconfalse14191419260617643generic_table_pkey CONSTRAINT^ALTER TABLE ONLY generic_table ADD CONSTRAINT generic_table_pkey PRIMARY KEY (serial_id); JALTER TABLE ONLY public.generic_table DROP CONSTRAINT generic_table_pkey; publicbeaconfalse14211421260617645inquire_nets_pkey CONSTRAINTkALTER TABLE ONLY inquire_nets ADD CONSTRAINT inquire_nets_pkey PRIMARY KEY (config_index, addr_block); HALTER TABLE ONLY public.inquire_nets DROP CONSTRAINT inquire_nets_pkey; publicbeaconfalse142214221422+260617788integration_pkey CONSTRAINTZALTER TABLE ONLY integration ADD CONSTRAINT integration_pkey PRIMARY KEY (serial_id); FALTER TABLE ONLY public.integration DROP CONSTRAINT integration_pkey; publicbeaconfalse14991499260617649ip_history_pkey CONSTRAINTXALTER TABLE ONLY ip_history ADD CONSTRAINT ip_history_pkey PRIMARY KEY (serial_id); DALTER TABLE ONLY public.ip_history DROP CONSTRAINT ip_history_pkey; publicbeaconfalse14241424260617651ip_model_historical_pkey CONSTRAINTjALTER TABLE ONLY ip_model_historical ADD CONSTRAINT ip_model_historical_pkey PRIMARY KEY (serial_id); VALTER TABLE ONLY public.ip_model_historical DROP CONSTRAINT ip_model_historical_pkey; publicbeaconfalse14281428260617653 ip_model_pkey CONSTRAINTTALTER TABLE ONLY ip_model ADD CONSTRAINT ip_model_pkey PRIMARY KEY (serial_id); @ALTER TABLE ONLY public.ip_model DROP CONSTRAINT ip_model_pkey; publicbeaconfalse14261426260617655 ip_rule_pkey CONSTRAINTRALTER TABLE ONLY ip_rule ADD CONSTRAINT ip_rule_pkey PRIMARY KEY (serial_id); >ALTER TABLE ONLY public.ip_rule DROP CONSTRAINT ip_rule_pkey; publicbeaconfalse14301430260617657mac_history_pkey CONSTRAINTZALTER TABLE ONLY mac_history ADD CONSTRAINT mac_history_pkey PRIMARY KEY (serial_id); FALTER TABLE ONLY public.mac_history DROP CONSTRAINT mac_history_pkey; publicbeaconfalse14321432260617659mac_model_historical_pkey CONSTRAINTlALTER TABLE ONLY mac_model_historical ADD CONSTRAINT mac_model_historical_pkey PRIMARY KEY (serial_id); XALTER TABLE ONLY public.mac_model_historical DROP CONSTRAINT mac_model_historical_pkey; publicbeaconfalse14361436260617661mac_model_pkey CONSTRAINTVALTER TABLE ONLY mac_model ADD CONSTRAINT mac_model_pkey PRIMARY KEY (serial_id); BALTER TABLE ONLY public.mac_model DROP CONSTRAINT mac_model_pkey; publicbeaconfalse14341434260617663 mac_rule_pkey CONSTRAINTTALTER TABLE ONLY mac_rule ADD CONSTRAINT mac_rule_pkey PRIMARY KEY (serial_id); @ALTER TABLE ONLY public.mac_rule DROP CONSTRAINT mac_rule_pkey; publicbeaconfalse14381438-260617799managable_devices_pkey CONSTRAINTfALTER TABLE ONLY managable_devices ADD CONSTRAINT managable_devices_pkey PRIMARY KEY (serial_id); RALTER TABLE ONLY public.managable_devices DROP CONSTRAINT managable_devices_pkey; publicbeaconfalse15011501260617667middleware_config_pkey CONSTRAINTfALTER TABLE ONLY middleware_config ADD CONSTRAINT middleware_config_pkey PRIMARY KEY (serial_id); RALTER TABLE ONLY public.middleware_config DROP CONSTRAINT middleware_config_pkey; publicbeaconfalse14401440260617669nac_table_pkey CONSTRAINTVALTER TABLE ONLY nac_table ADD CONSTRAINT nac_table_pkey PRIMARY KEY (serial_id); BALTER TABLE ONLY public.nac_table DROP CONSTRAINT nac_table_pkey; publicbeaconfalse14421442260617671 net_rule_pkey CONSTRAINTTALTER TABLE ONLY net_rule ADD CONSTRAINT net_rule_pkey PRIMARY KEY (serial_id); @ALTER TABLE ONLY public.net_rule DROP CONSTRAINT net_rule_pkey; publicbeaconfalse14441444260617673netdev_events_pkey CONSTRAINT^ALTER TABLE ONLY netdev_events ADD CONSTRAINT netdev_events_pkey PRIMARY KEY (serial_id); JALTER TABLE ONLY public.netdev_events DROP CONSTRAINT netdev_events_pkey; publicbeaconfalse14461446260617675netflow_nets_pkey CONSTRAINTkALTER TABLE ONLY netflow_nets ADD CONSTRAINT netflow_nets_pkey PRIMARY KEY (config_index, addr_block); HALTER TABLE ONLY public.netflow_nets DROP CONSTRAINT netflow_nets_pkey; publicbeaconfalse144714471447260617677netinquiry_config_pkey CONSTRAINTfALTER TABLE ONLY netinquiry_config ADD CONSTRAINT netinquiry_config_pkey PRIMARY KEY (pol_index); RALTER TABLE ONLY public.netinquiry_config DROP CONSTRAINT netinquiry_config_pkey; publicbeaconfalse14481448260617679netmap_config_pkey CONSTRAINT^ALTER TABLE ONLY netmap_config ADD CONSTRAINT netmap_config_pkey PRIMARY KEY (pol_index); JALTER TABLE ONLY public.netmap_config DROP CONSTRAINT netmap_config_pkey; publicbeaconfalse14491449260617681netport_events_pkey CONSTRAINT`ALTER TABLE ONLY netport_events ADD CONSTRAINT netport_events_pkey PRIMARY KEY (serial_id); LALTER TABLE ONLY public.netport_events DROP CONSTRAINT netport_events_pkey; publicbeaconfalse14511451260617683netrelay_config_pkey CONSTRAINTbALTER TABLE ONLY netrelay_config ADD CONSTRAINT netrelay_config_pkey PRIMARY KEY (pol_index); NALTER TABLE ONLY public.netrelay_config DROP CONSTRAINT netrelay_config_pkey; publicbeaconfalse14521452260617685nettrap_config_pkey CONSTRAINTcALTER TABLE ONLY nettrap_config ADD CONSTRAINT nettrap_config_pkey PRIMARY KEY (ipaddr, port); LALTER TABLE ONLY public.nettrap_config DROP CONSTRAINT nettrap_config_pkey; publicbeaconfalse145314531453260617687netwatch_config_pkey CONSTRAINTmALTER TABLE ONLY netwatch_config ADD CONSTRAINT netwatch_config_pkey PRIMARY KEY (pol_index, interface); NALTER TABLE ONLY public.netwatch_config DROP CONSTRAINT netwatch_config_pkey; publicbeaconfalse145514551455260617689network_device_pkey CONSTRAINT]ALTER TABLE ONLY network_device ADD CONSTRAINT network_device_pkey PRIMARY KEY (ipaddr); LALTER TABLE ONLY public.network_device DROP CONSTRAINT network_device_pkey; publicbeaconfalse14591459260617691network_neighbor_pkey CONSTRAINTjALTER TABLE ONLY network_neighbor ADD CONSTRAINT network_neighbor_pkey PRIMARY KEY (device_ip, port); PALTER TABLE ONLY public.network_neighbor DROP CONSTRAINT network_neighbor_pkey; publicbeaconfalse146014601460260617693 network_pkey CONSTRAINTQALTER TABLE ONLY network ADD CONSTRAINT network_pkey PRIMARY KEY (org_name); >ALTER TABLE ONLY public.network DROP CONSTRAINT network_pkey; publicbeaconfalse14571457260617695network_port_pkey CONSTRAINTbALTER TABLE ONLY network_port ADD CONSTRAINT network_port_pkey PRIMARY KEY (device_ip, port); HALTER TABLE ONLY public.network_port DROP CONSTRAINT network_port_pkey; publicbeaconfalse146114611461260617697node_active_pkey CONSTRAINTSALTER TABLE ONLY node_active ADD CONSTRAINT node_active_pkey PRIMARY KEY (ip); FALTER TABLE ONLY public.node_active DROP CONSTRAINT node_active_pkey; publicbeaconfalse14621462260617699node_data_pkey CONSTRAINTVALTER TABLE ONLY node_data ADD CONSTRAINT node_data_pkey PRIMARY KEY (serial_id); BALTER TABLE ONLY public.node_data DROP CONSTRAINT node_data_pkey; publicbeaconfalse14641464260617701node_name_pkey CONSTRAINTOALTER TABLE ONLY node_name ADD CONSTRAINT node_name_pkey PRIMARY KEY (ip); BALTER TABLE ONLY public.node_name DROP CONSTRAINT node_name_pkey; publicbeaconfalse14651465260617703node_software_pkey CONSTRAINT^ALTER TABLE ONLY node_software ADD CONSTRAINT node_software_pkey PRIMARY KEY (serial_id); JALTER TABLE ONLY public.node_software DROP CONSTRAINT node_software_pkey; publicbeaconfalse14671467260617705node_stack_pkey CONSTRAINTXALTER TABLE ONLY node_stack ADD CONSTRAINT node_stack_pkey PRIMARY KEY (serial_id); DALTER TABLE ONLY public.node_stack DROP CONSTRAINT node_stack_pkey; publicbeaconfalse14691469260617707node_traffic_pkey CONSTRAINT\ALTER TABLE ONLY node_traffic ADD CONSTRAINT node_traffic_pkey PRIMARY KEY (serial_id); HALTER TABLE ONLY public.node_traffic DROP CONSTRAINT node_traffic_pkey; publicbeaconfalse14711471260617709 oui_ref_pkey CONSTRAINTLALTER TABLE ONLY oui_ref ADD CONSTRAINT oui_ref_pkey PRIMARY KEY (mac); >ALTER TABLE ONLY public.oui_ref DROP CONSTRAINT oui_ref_pkey; publicbeaconfalse14721472 260617711port_connection_pkey CONSTRAINTgALTER TABLE ONLY port_connection ADD CONSTRAINT port_connection_pkey PRIMARY KEY (device_ip, mac); NALTER TABLE ONLY public.port_connection DROP CONSTRAINT port_connection_pkey; publicbeaconfalse147314731473 260617713port_rule_pkey CONSTRAINTVALTER TABLE ONLY port_rule ADD CONSTRAINT port_rule_pkey PRIMARY KEY (serial_id); BALTER TABLE ONLY public.port_rule DROP CONSTRAINT port_rule_pkey; publicbeaconfalse14751475260617715profile_diff_pkey CONSTRAINT\ALTER TABLE ONLY profile_diff ADD CONSTRAINT profile_diff_pkey PRIMARY KEY (serial_id); HALTER TABLE ONLY public.profile_diff DROP CONSTRAINT profile_diff_pkey; publicbeaconfalse14791479260617717!profile_directory_historical_pkey CONSTRAINT|ALTER TABLE ONLY profile_directory_historical ADD CONSTRAINT profile_directory_historical_pkey PRIMARY KEY (serial_id); hALTER TABLE ONLY public.profile_directory_historical DROP CONSTRAINT profile_directory_historical_pkey; publicbeaconfalse14831483260617719profile_directory_pkey CONSTRAINT`ALTER TABLE ONLY profile_directory ADD CONSTRAINT profile_directory_pkey PRIMARY KEY (mac); RALTER TABLE ONLY public.profile_directory DROP CONSTRAINT profile_directory_pkey; publicbeaconfalse14811481260617721 profile_pkey CONSTRAINTMALTER TABLE ONLY profile ADD CONSTRAINT profile_pkey PRIMARY KEY (name); >ALTER TABLE ONLY public.profile DROP CONSTRAINT profile_pkey; publicbeaconfalse14771477260617723proto_rule_pkey CONSTRAINTXALTER TABLE ONLY proto_rule ADD CONSTRAINT proto_rule_pkey PRIMARY KEY (serial_id); DALTER TABLE ONLY public.proto_rule DROP CONSTRAINT proto_rule_pkey; publicbeaconfalse14851485260617725router_interfaces_pkey CONSTRAINTfALTER TABLE ONLY router_interfaces ADD CONSTRAINT router_interfaces_pkey PRIMARY KEY (serial_id); RALTER TABLE ONLY public.router_interfaces DROP CONSTRAINT router_interfaces_pkey; publicbeaconfalse14871487260617727server_commands_pkey CONSTRAINTcALTER TABLE ONLY server_commands ADD CONSTRAINT server_commands_pkey PRIMARY KEY (command_id); NALTER TABLE ONLY public.server_commands DROP CONSTRAINT server_commands_pkey; publicbeaconfalse14891489 260617729server_config_pkey CONSTRAINT^ALTER TABLE ONLY server_config ADD CONSTRAINT server_config_pkey PRIMARY KEY (pol_index); JALTER TABLE ONLY public.server_config DROP CONSTRAINT server_config_pkey; publicbeaconfalse14901490"260617731stack_rule_pkey CONSTRAINTXALTER TABLE ONLY stack_rule ADD CONSTRAINT stack_rule_pkey PRIMARY KEY (serial_id); DALTER TABLE ONLY public.stack_rule DROP CONSTRAINT stack_rule_pkey; publicbeaconfalse14921492$260617733static_profile_pkey CONSTRAINT`ALTER TABLE ONLY static_profile ADD CONSTRAINT static_profile_pkey PRIMARY KEY (serial_id); LALTER TABLE ONLY public.static_profile DROP CONSTRAINT static_profile_pkey; publicbeaconfalse14941494'260617735trunk_ports_pkey CONSTRAINT`ALTER TABLE ONLY trunk_ports ADD CONSTRAINT trunk_ports_pkey PRIMARY KEY (device_ip, port); FALTER TABLE ONLY public.trunk_ports DROP CONSTRAINT trunk_ports_pkey; publicbeaconfalse149514951495)260617737user_accounts_pkey CONSTRAINTYALTER TABLE ONLY user_accounts ADD CONSTRAINT user_accounts_pkey PRIMARY KEY (name); JALTER TABLE ONLY public.user_accounts DROP CONSTRAINT user_accounts_pkey; publicbeaconfalse14971497125917738arp_table_ip_indexINDEX?CREATE INDEX arp_table_ip_index ON arp_table USING btree (ip); &DROP INDEX public.arp_table_ip_index; publicbeaconfalse1394125917739arp_table_ip_mac_indexINDEXHCREATE INDEX arp_table_ip_mac_index ON arp_table USING btree (ip, mac); *DROP INDEX public.arp_table_ip_mac_index; publicbeaconfalse13941394125917740arp_table_mac_indexINDEXACREATE INDEX arp_table_mac_index ON arp_table USING btree (mac); 'DROP INDEX public.arp_table_mac_index; publicbeaconfalse1394125917741asset_tracking_mac_indexINDEXKCREATE INDEX asset_tracking_mac_index ON asset_tracking USING btree (mac); ,DROP INDEX public.asset_tracking_mac_index; publicbeaconfalse1395125917742ip_history_ip_indexINDEXACREATE INDEX ip_history_ip_index ON ip_history USING btree (ip); 'DROP INDEX public.ip_history_ip_index; publicbeaconfalse1424125917743ip_history_ip_mac_indexINDEXJCREATE INDEX ip_history_ip_mac_index ON ip_history USING btree (ip, mac); +DROP INDEX public.ip_history_ip_mac_index; publicbeaconfalse14241424125917744ip_model_historical_ip_indexINDEXWCREATE INDEX ip_model_historical_ip_index ON ip_model_historical USING btree (ipaddr); 0DROP INDEX public.ip_model_historical_ip_index; publicbeaconfalse1428125917745ip_model_ip_indexINDEXACREATE INDEX ip_model_ip_index ON ip_model USING btree (ipaddr); %DROP INDEX public.ip_model_ip_index; publicbeaconfalse1426125917746mac_history_ipport_indexINDEXTCREATE INDEX mac_history_ipport_index ON mac_history USING btree (device_ip, port); ,DROP INDEX public.mac_history_ipport_index; publicbeaconfalse14321432125917747mac_history_mac_indexINDEXECREATE INDEX mac_history_mac_index ON mac_history USING btree (mac); )DROP INDEX public.mac_history_mac_index; publicbeaconfalse1432125917770mac_model_historical_ip_indexINDEXYCREATE INDEX mac_model_historical_ip_index ON mac_model_historical USING btree (ipaddr); 1DROP INDEX public.mac_model_historical_ip_index; publicbeaconfalse1436125917748mac_model_historical_mac_indexINDEXWCREATE INDEX mac_model_historical_mac_index ON mac_model_historical USING btree (mac); 2DROP INDEX public.mac_model_historical_mac_index; publicbeaconfalse1436125917749mac_model_ip_indexINDEXCCREATE INDEX mac_model_ip_index ON mac_model USING btree (ipaddr); &DROP INDEX public.mac_model_ip_index; publicbeaconfalse1434125917750mac_model_mac_indexINDEXACREATE INDEX mac_model_mac_index ON mac_model USING btree (mac); 'DROP INDEX public.mac_model_mac_index; publicbeaconfalse1434125917751network_port_mac_indexINDEXGCREATE INDEX network_port_mac_index ON network_port USING btree (mac); *DROP INDEX public.network_port_mac_index; publicbeaconfalse1461125917752node_data_ip_data_indexINDEXOCREATE INDEX node_data_ip_data_index ON node_data USING btree (ip, data_type); +DROP INDEX public.node_data_ip_data_index; publicbeaconfalse14641464125917753node_data_ip_indexINDEX?CREATE INDEX node_data_ip_index ON node_data USING btree (ip); &DROP INDEX public.node_data_ip_index; publicbeaconfalse1464125917754node_data_mac_data_indexINDEXQCREATE INDEX node_data_mac_data_index ON node_data USING btree (mac, data_type); ,DROP INDEX public.node_data_mac_data_index; publicbeaconfalse14641464125917755node_data_mac_indexINDEXACREATE INDEX node_data_mac_index ON node_data USING btree (mac); 'DROP INDEX public.node_data_mac_index; publicbeaconfalse1464125917756node_name_ip_indexINDEX?