| 1 |
/**************************************************************************/ |
| 2 |
/* */ |
| 3 |
/* This file is part of Frama-C. */ |
| 4 |
/* */ |
| 5 |
/* Copyright (C) 2007-2022 */ |
| 6 |
/* CEA (Commissariat à l'énergie atomique et aux énergies */ |
| 7 |
/* alternatives) */ |
| 8 |
/* */ |
| 9 |
/* you can redistribute it and/or modify it under the terms of the GNU */ |
| 10 |
/* Lesser General Public License as published by the Free Software */ |
| 11 |
/* Foundation, version 2.1. */ |
| 12 |
/* */ |
| 13 |
/* It is distributed in the hope that it will be useful, */ |
| 14 |
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
| 15 |
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
| 16 |
/* GNU Lesser General Public License for more details. */ |
| 17 |
/* */ |
| 18 |
/* See the GNU Lesser General Public License version 2.1 */ |
| 19 |
/* for more details (enclosed in the file licenses/LGPLv2.1). */ |
| 20 |
/* */ |
| 21 |
/**************************************************************************/ |
| 22 |
|
| 23 |
#ifndef FC_IOCTL |
| 24 |
#define FC_IOCTL |
| 25 |
|
| 26 |
// This file is neither in the C standard nor POSIX; it is here for |
| 27 |
// compatibility reasons. |
| 28 |
|
| 29 |
// For the ioctl() prototype |
| 30 |
#include "../stropts.h" |
| 31 |
|
| 32 |
struct winsize |
| 33 |
{ |
| 34 |
unsigned short int ws_row; |
| 35 |
unsigned short int ws_col; |
| 36 |
unsigned short int ws_xpixel; |
| 37 |
unsigned short int ws_ypixel; |
| 38 |
}; |
| 39 |
|
| 40 |
/* Routing table calls. */ |
| 41 |
#define SIOCADDRT 0x890B /* add routing table entry */ |
| 42 |
#define SIOCDELRT 0x890C /* delete routing table entry */ |
| 43 |
#define SIOCRTMSG 0x890D /* call to routing system */ |
| 44 |
|
| 45 |
|
| 46 |
/* Socket configuration controls. */ |
| 47 |
#define SIOCGIFNAME 0x8910 /* get iface name */ |
| 48 |
#define SIOCSIFLINK 0x8911 /* set iface channel */ |
| 49 |
#define SIOCGIFCONF 0x8912 /* get iface list */ |
| 50 |
#define SIOCGIFFLAGS 0x8913 /* get flags */ |
| 51 |
#define SIOCSIFFLAGS 0x8914 /* set flags */ |
| 52 |
#define SIOCGIFADDR 0x8915 /* get PA address */ |
| 53 |
#define SIOCSIFADDR 0x8916 /* set PA address */ |
| 54 |
#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */ |
| 55 |
#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */ |
| 56 |
#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */ |
| 57 |
#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */ |
| 58 |
#define SIOCGIFNETMASK 0x891b /* get network PA mask */ |
| 59 |
#define SIOCSIFNETMASK 0x891c /* set network PA mask */ |
| 60 |
#define SIOCGIFMETRIC 0x891d /* get metric */ |
| 61 |
#define SIOCSIFMETRIC 0x891e /* set metric */ |
| 62 |
#define SIOCGIFMEM 0x891f /* get memory address (BSD) */ |
| 63 |
#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */ |
| 64 |
#define SIOCGIFMTU 0x8921 /* get MTU size */ |
| 65 |
#define SIOCSIFMTU 0x8922 /* set MTU size */ |
| 66 |
#define SIOCSIFNAME 0x8923 /* set interface name */ |
| 67 |
#define SIOCSIFHWADDR 0x8924 /* set hardware address */ |
| 68 |
#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */ |
| 69 |
#define SIOCSIFENCAP 0x8926 |
| 70 |
#define SIOCGIFHWADDR 0x8927 /* Get hardware address */ |
| 71 |
#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */ |
| 72 |
#define SIOCSIFSLAVE 0x8930 |
| 73 |
#define SIOCADDMULTI 0x8931 /* Multicast address lists */ |
| 74 |
#define SIOCDELMULTI 0x8932 |
| 75 |
#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */ |
| 76 |
#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */ |
| 77 |
#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */ |
| 78 |
#define SIOCGIFPFLAGS 0x8935 |
| 79 |
#define SIOCDIFADDR 0x8936 /* delete PA address */ |
| 80 |
#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */ |
| 81 |
#define SIOCGIFCOUNT 0x8938 /* get number of devices */ |
| 82 |
|
| 83 |
#define SIOCGIFBR 0x8940 /* Bridging support */ |
| 84 |
#define SIOCSIFBR 0x8941 /* Set bridging options */ |
| 85 |
|
| 86 |
#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ |
| 87 |
#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ |
| 88 |
|
| 89 |
|
| 90 |
/* ARP cache control calls. */ |
| 91 |
/* 0x8950 - 0x8952 * obsolete calls, don't re-use */ |
| 92 |
#define SIOCDARP 0x8953 /* delete ARP table entry */ |
| 93 |
#define SIOCGARP 0x8954 /* get ARP table entry */ |
| 94 |
#define SIOCSARP 0x8955 /* set ARP table entry */ |
| 95 |
|
| 96 |
/* RARP cache control calls. */ |
| 97 |
#define SIOCDRARP 0x8960 /* delete RARP table entry */ |
| 98 |
#define SIOCGRARP 0x8961 /* get RARP table entry */ |
| 99 |
#define SIOCSRARP 0x8962 /* set RARP table entry */ |
| 100 |
|
| 101 |
/* Driver configuration calls */ |
| 102 |
|
| 103 |
#define SIOCGIFMAP 0x8970 /* Get device parameters */ |
| 104 |
#define SIOCSIFMAP 0x8971 /* Set device parameters */ |
| 105 |
|
| 106 |
/* DLCI configuration calls */ |
| 107 |
|
| 108 |
#define SIOCADDDLCI 0x8980 /* Create new DLCI device */ |
| 109 |
#define SIOCDELDLCI 0x8981 /* Delete DLCI device */ |
| 110 |
|
| 111 |
/* Device private ioctl calls. */ |
| 112 |
|
| 113 |
/* These 16 ioctls are available to devices via the do_ioctl() device |
| 114 |
vector. Each device should include this file and redefine these |
| 115 |
names as their own. Because these are device dependent it is a good |
| 116 |
idea _NOT_ to issue them to random objects and hope. */ |
| 117 |
|
| 118 |
#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */ |
| 119 |
|
| 120 |
/* |
| 121 |
* These 16 ioctl calls are protocol private |
| 122 |
*/ |
| 123 |
|
| 124 |
#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */ |
| 125 |
|
| 126 |
|
| 127 |
// Some definitions from ioctls.h |
| 128 |
|
| 129 |
#define TCGETS 0x5401 |
| 130 |
#define TCSETS 0x5402 |
| 131 |
#define TCSETSW 0x5403 |
| 132 |
#define TCSETSF 0x5404 |
| 133 |
#define TCGETA 0x5405 |
| 134 |
#define TCSETA 0x5406 |
| 135 |
#define TCSETAW 0x5407 |
| 136 |
#define TCSETAF 0x5408 |
| 137 |
#define TCSBRK 0x5409 |
| 138 |
#define TCXONC 0x540A |
| 139 |
#define TCFLSH 0x540B |
| 140 |
#define TIOCEXCL 0x540C |
| 141 |
#define TIOCNXCL 0x540D |
| 142 |
#define TIOCSCTTY 0x540E |
| 143 |
#define TIOCGPGRP 0x540F |
| 144 |
#define TIOCSPGRP 0x5410 |
| 145 |
#define TIOCOUTQ 0x5411 |
| 146 |
#define TIOCSTI 0x5412 |
| 147 |
#define TIOCGWINSZ 0x5413 |
| 148 |
#define TIOCSWINSZ 0x5414 |
| 149 |
#define TIOCMGET 0x5415 |
| 150 |
#define TIOCMBIS 0x5416 |
| 151 |
#define TIOCMBIC 0x5417 |
| 152 |
#define TIOCMSET 0x5418 |
| 153 |
#define TIOCGSOFTCAR 0x5419 |
| 154 |
#define TIOCSSOFTCAR 0x541A |
| 155 |
#define FIONREAD 0x541B |
| 156 |
#define TIOCINQ FIONREAD |
| 157 |
#define TIOCLINUX 0x541C |
| 158 |
#define TIOCCONS 0x541D |
| 159 |
#define TIOCGSERIAL 0x541E |
| 160 |
#define TIOCSSERIAL 0x541F |
| 161 |
#define TIOCPKT 0x5420 |
| 162 |
#define FIONBIO 0x5421 |
| 163 |
#define TIOCNOTTY 0x5422 |
| 164 |
#define TIOCSETD 0x5423 |
| 165 |
#define TIOCGETD 0x5424 |
| 166 |
#define TCSBRKP 0x5425 |
| 167 |
#define TIOCSBRK 0x5427 |
| 168 |
#define TIOCCBRK 0x5428 |
| 169 |
#define TIOCGSID 0x5429 |
| 170 |
#define TIOCGRS485 0x542E |
| 171 |
#ifndef TIOCSRS485 |
| 172 |
#define TIOCSRS485 0x542F |
| 173 |
#endif |
| 174 |
#define TCGETX 0x5432 |
| 175 |
#define TCSETX 0x5433 |
| 176 |
#define TCSETXF 0x5434 |
| 177 |
#define TCSETXW 0x5435 |
| 178 |
#define TIOCVHANGUP 0x5437 |
| 179 |
|
| 180 |
#define FIONCLEX 0x5450 |
| 181 |
#define FIOCLEX 0x5451 |
| 182 |
#define FIOASYNC 0x5452 |
| 183 |
#define TIOCSERCONFIG 0x5453 |
| 184 |
#define TIOCSERGWILD 0x5454 |
| 185 |
#define TIOCSERSWILD 0x5455 |
| 186 |
#define TIOCGLCKTRMIOS 0x5456 |
| 187 |
#define TIOCSLCKTRMIOS 0x5457 |
| 188 |
#define TIOCSERGSTRUCT 0x5458 |
| 189 |
#define TIOCSERGETLSR 0x5459 |
| 190 |
#define TIOCSERGETMULTI 0x545A |
| 191 |
#define TIOCSERSETMULTI 0x545B |
| 192 |
|
| 193 |
#define TIOCMIWAIT 0x545C |
| 194 |
#define TIOCGICOUNT 0x545D |
| 195 |
|
| 196 |
#ifndef FIOQSIZE |
| 197 |
# define FIOQSIZE 0x5460 |
| 198 |
#endif |
| 199 |
|
| 200 |
#define TIOCPKT_DATA 0 |
| 201 |
#define TIOCPKT_FLUSHREAD 1 |
| 202 |
#define TIOCPKT_FLUSHWRITE 2 |
| 203 |
#define TIOCPKT_STOP 4 |
| 204 |
#define TIOCPKT_START 8 |
| 205 |
#define TIOCPKT_NOSTOP 16 |
| 206 |
#define TIOCPKT_DOSTOP 32 |
| 207 |
#define TIOCPKT_IOCTL 64 |
| 208 |
|
| 209 |
#define TIOCSER_TEMT 0x01 |
| 210 |
|
| 211 |
#endif |