package com.wjholden.nmap;

import android.view.Menu;

/**
 * All the global constants should go here for simplicity.
 * 
 * @author William John Holden (wjholden@gmail.com)
 * @version 0.4.1
 * @since 0.4
 */
public interface NmapConstants {
	/**
	 * Tells handler there is no root access on this handset
	 */
	 int INSTALL_NO_ROOT = 0;
	
	/**
	 * Indicates generic installation error
	 */
	 int INSTALL_ERROR = 1;
	
	/**
	 * Indicates successful installation (or successfully verified)
	 */
	 int INSTALL_GOOD = 2;
	
	/**
	 * Tells the handler that your Message object contains one line of output.
	 * @deprecated Deprecated in version 28. This harkens back to a dark era where
	 * errors were sent to the handler one line at a time. This was a horribly
	 * inefficient use of Strings. Use RUN_SUCCESS_NO_FILE instead when you're getting
	 * standard output instead of -oA files.
	 */
	 @Deprecated
	 int RUN_LINE = 3;
	
	/**
	 * Tells the handler the scan has completed
	 */
	int RUN_COMPLETE = 4;
	
	/**
	 * Tells the handler an error occurred
	 */
	 int RUN_ERROR = 5;
	 
	 int THREAD_ERROR = 6;
	 
	 /**
	  * @deprecated Now that I'm providing Nmap 5.50 and Nmap 5.30BETA1 this is no longer appropriate.
	  */
	 @Deprecated
	 int SCANTYPE_NMAP = 7;
	 
	 /*
	  * No longer used because I have to keep continuity with the other variables.
	  * TODO: Perhaps I need to go back and make these start at zero instead?
	  * The menu items are contiguous, starting at zero - why shouldn't these? 
	 int SCANTYPE_NPING = 8;
	 */
	 
	 int SCANTYPE_NCAT = 9;
	 
	 int SCANTYPE_NDIFF = 10;
	 
	 int FORCE_RESTART = 11;
	 
	 /**
	  * Tells the handler that the run was successful, but there are no files generated by
	  * -oA to process and that it should display only the output provided in RUN_LINE.
	  */
	 int RUN_SUCCESS_NO_FILE = 12;
	 
	 int SCANTYPE_NMAP_SVN = 13;
	 
	 int SCANTYPE_ATRIX = 14;
	 
	 int SCANTYPE_NPING = 15;
	 
	 /**
	  * Sets the title of the main application window to whatever is in Message.obj.
	  */
	 int SET_TITLE = 16;
	 
	 int LICENSE_VERIFIED = 17;
	 
	 int SCAN_STARTED = 18;
	
	 /**
	  * This tag is used by Logcat to print app name.
	  */
	 String TAG = "Nmap";
	
	/**
	 * Android keeps bitching about not explicitly saying you want an 8k-char buffer so...here.
	 */
	 int BUFFER_SIZE = 8192;

	 /**
	  * Button to enable/disable debugging
	  */
	 int MI_DEBUG_ENABLE = Menu.FIRST;
	 
	 /**
	  * Button to e-mail debugging info to developer
	  */
	 int MI_DEBUG_EMAIL = Menu.FIRST + 1;
	 
	 /**
	  * Button that opens Nmap manpage
	  */
	 int MI_MORE_HELP = Menu.FIRST + 2;
	 
	 /**
	  * Button that initiates VerifyInstallation method manually
	  */
	 int MI_REINSTALL = Menu.FIRST + 3;
	 
	 /**
	  * Button that shows the survey, collecting information at 
	  * <a href="http://nmap.wjholden.com/data.php">nmap.wjholden.com</a>.
	  */
	 int MI_SURVEY = Menu.FIRST + 4;
	 
	 /**
	  * Button showing advanced options dialog box.
	  */
	 int MI_ADVANCED = Menu.FIRST + 5;
	 
	 /**
	  * Button showing NmapSubnet activity.
	  */
	 int MI_SUBNET = Menu.FIRST + 5;
	 
	 int MI_EXIT = Menu.FIRST + 6;
	
	 int MG_DEBUG = Menu.FIRST;
	 
	 int MG_DEFAULT = Menu.FIRST + 1;
	 
	 /**
	  * Menu group for NmapSubnet activity.
	  */
	 int MG_SUBNET = Menu.FIRST + 2;
	 
	 /**
	  * For NmapSubnet - show IPv4 addresses in dotted-decimal format.
	  */
	 int MI_DEC = Menu.FIRST;
	 
	 /**
	  * For NmapSubnet - show IPv4 addresses in hexidecimal.
	  */
	 int MI_HEX = Menu.FIRST + 1;
	 
	 /**
	  * For NmapSubnet - show IPv4 addresses in binary.
	  */
	 int MI_BIN = Menu.FIRST + 2;
	 
	 /**
	  * For NmapSubnet - e-mail all output.
	  */
	 int MI_EMAIL_SUBNET = Menu.FIRST + 3;
	 
	 /**
	 * List of filenames corresponding to those resources made available in requiredResources[].
	 */
	String INSTALL_FILENAMES[] = { "nmap-protocols", "nmap-rpc", "nmap-services", "nmap-mac-prefixes", "nmap-payloads" };
	
	/**
	 * The name is somewhat misleading now, but these are a few files that should be 
	 * installed during this process.  The list is not all-inclusive (not R.raw.nmap absent)
	 * because some files are so large they had to be split, therefore they couldn't be 
	 * installed in this neat interative process.
	 */
	int INSTALL_RESOURCES[] = { R.raw.nmap_protocols, R.raw.nmap_rpc, R.raw.nmap_services, R.raw.nmap_mac_prefixes, R.raw.nmap_payloads };
	
	/**
	 * Interval, in milliseconds, for polling NmapWifi.wifiIsConnected. Currently set to 1 second
	 * as the poll logic is intentionally lightweight and can run frequently with little overhead.
	 */
	int SUBNET_POLL_INTERVAL = 1000;
	
	/**
	 * Tells NmapSubnet.handler that the wifi is disconnected.
	 */
	int SUBNET_DISCONNECTED = 0;
	
	/**
	 * Tells NmapSubnet.handler that the wifi is connected.
	 */
	int SUBNET_CONNECTED = 1;
	
	/**
	 * License public key.
	 */
	String BASE64_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuoLMeBwrgLi3y+ccrNcPuyXLTv3bwA1LujZDwS6gYDHZoQJly8NL8bbo/IZlc3cXLUwTsDpoiz1jFrIoQvMbfiB9tcTFDfsYJRqCS3WH6GXPZbuUEofTie+AQZB6AMzeRHpjRqlZGIWsYWXNrp9Q7kFYfiD2D8PMGiIZOjrNumrbucaiO5ptae+yHsQAmGNhggz3CBoFOdYfs/EbuTv7kimAi4WMaJvPANvedwUCzL27ux5BdUU5ETgsUhamkFDAXn8LWIZBUQNMFCGMBTw4x19sjDvfoX3SOxg/4PHMkQzgegK0oILFawbfUtiBT9eU8JGqgIQvsgcTBWa9jtJjywIDAQAB";
	
	/**
	 * Some random bytes for license verification. Kinda silly for open-source software, but whatever. This is all learning.
	 */
	byte[] SALT = new byte[] {
			-12, 44, -23, 5, 0, 104, 80, -33, 1, 0,
			11, -106, 22, 5, -1, 99, 41, -19, 44, 32
	};
}
