1--
2--  Copyright (C) 2011-2014 Reto Buerki <reet@codelabs.ch>
3--  Copyright (C) 2011-2014 Adrian-Ken Rueegsegger <ken@codelabs.ch>
4--
5--  This program is free software; you can redistribute it and/or modify it
6--  under the terms of the GNU General Public License as published by the
7--  Free Software Foundation; either version 2 of the License, or (at your
8--  option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
9--
10--  This program is distributed in the hope that it will be useful, but
11--  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12--  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13--  for more details.
14--
15--  As a special exception, if other files instantiate generics from this
16--  unit,  or  you  link  this  unit  with  other  files  to  produce  an
17--  executable   this  unit  does  not  by  itself  cause  the  resulting
18--  executable to  be  covered by the  GNU General  Public License.  This
19--  exception does  not  however  invalidate  any  other reasons why  the
20--  executable file might be covered by the GNU Public License.
21--
22
23package Anet.Sockets.Thin.Netdev.Requests is
24
25   SIOCGIFADDR   : constant := 16#8915#; --  Get address
26   SIOCGIFFLAGS  : constant := 16#8913#; --  Get flags
27   SIOCSIFFLAGS  : constant := 16#8914#; --  Set flags
28   SIOCGIFHWADDR : constant := 16#8927#; --  Get hardware address
29   SIOCGIFINDEX  : constant := 16#8933#; --  Name -> if_index mapping
30
31   Get_Requests : constant array (Netdev_Request_Name) of Interfaces.C.int
32     := (If_Addr   => SIOCGIFADDR,
33         If_Flags  => SIOCGIFFLAGS,
34         If_Hwaddr => SIOCGIFHWADDR,
35         If_Index  => SIOCGIFINDEX);
36   --  Currently supported netdevice ioctl get requests.
37
38   Set_Requests : constant array (Netdev_Request_Name) of Interfaces.C.int
39     := (If_Flags => SIOCSIFFLAGS,
40         others   => Interfaces.C.int (-1));
41   --  Currently supported netdevice ioctl set requests.
42
43   function C_Ioctl
44     (S   : Interfaces.C.int;
45      Req : Interfaces.C.int;
46      Arg : access If_Req_Type)
47      return Interfaces.C.int;
48   pragma Import (C, C_Ioctl, "ioctl");
49
50end Anet.Sockets.Thin.Netdev.Requests;
51