--	Package File Template

library IEEE;
use IEEE.STD_LOGIC_1164.all;

package my_constants is
	-----------------------------------------------------------------------------
		  ------------- Uzivatelem definovane parametry jadra -------------
	-----------------------------------------------------------------------------
	constant FPGA_MAC		: std_logic_vector(47 downto 0) 	:= x"AABBCCDDEEFF";	-- MAC aa:bb:cc:dd:ee:ff
   constant FPGA_IP		: std_logic_vector(31 downto 0)	:= x"0A1402D5";		-- IP 10.20.2.213
   constant GATEWAY		: std_logic_vector(31 downto 0)	:= x"0A140201";		-- IP brany  pro pripojeni k internetu 10.20.2.1
   constant IP_MASK		: std_logic_vector(31 downto 0) 	:= x"FFFFFF00";		-- IP maska pro lokalni sit 255.255.255.0
	-- Parametry UDP paketu - porty
	constant FPGA_PORT	: std_logic_vector(15 downto 0) 	:= x"7DDE";				-- UDP port 32222dec
	constant PC_PORT		: std_logic_vector(15 downto 0) 	:= x"7DDE";				-- UDP port 32222dec
	constant UDP_ADDR_WIDTH: integer := 10; -- velikost UDP bufferu = maximalni velikost UDP datagramu - nepřímo určuje MTU ramce (MTU = 2^UDP_ADDR_WIDTH + 20 + 16)											
	-- Parametry aplikacni vrstvy APP 	
	constant APP_ADDR_WIDTH : integer := 1; --(2^3 paketu) Velikost out. bufferu (urcuje pocet UDP bloku: 2^APP_ADDR_WIDTH) -> maximum je 7!!!
	constant WINDOW_SIZE	: std_logic_vector(3 downto 0)	:= x"0";					-- pocet paketu v okne povolene hodnoty (3 = kazdy 4. paket)
	constant TIMEOUT_WIDTH: integer := 30;													-- Pocet bitu citace pro timeout 
	-----------------------------------------------------------------------------
	
	-----------------------------------------------------------------------------
	-- Parametry IP paketu -  tyto parametry nemenit !
	constant IP_VERSION	: std_logic_vector(3 downto 0) 	:= x"4";					-- verze protokolu IPv4
	constant IP_IHL		: std_logic_vector(3 downto 0) 	:= x"5";					-- velikost hlavicky ve 4 bytovych slovech
  	constant IP_TOS		: std_logic_vector(7 downto 0) 	:= x"00"; 				-- nepouziva se = 0

	constant IP_ID			: std_logic_vector(15 downto 0)	:= x"0000";				-- ID paketu - nedulezite protoze je fragmentace zakazana
	constant IP_FLAG		: std_logic_vector(2 downto 0) 	:= "010";				-- zakazeme fragmentaci
	constant IP_OFFSET	: std_logic_vector(12 downto 0)	:= (others => '0');	-- posunuti fragmentu 0
	constant IP_TTL		: std_logic_vector(7 downto 0) 	:= x"40";				-- doba zivota
	constant IP_PROTOCOL	: std_logic_vector(7 downto 0) 	:= x"11";				-- 17 = UDP
	-----------------------------------------------------------------------------

end my_constants;