ATM on Linux, magic numbers

This page lists ioctls, and soon also socket options, and other ATM-related magic numbers whose assignment requires central coordination. This reflects the status of the 0.65 ATM on Linux distribution for 2.3.39 kernels.
ATMIOC_PHYTYP macros are defined in include/linux/atmioc.h. Note that atmioc.h
also includes include/asm/ioctl.h for convenience. Code points are allocated
by taking the next higher free number. ioctls operating on the same object and
only differing in the direction (e.g. set/get) stil get different numbers.
Although private (*PRV) ioctls could overlap, I'll try to avoid this as long
as possible in order to avoid creating traps for subtle usage errors.

ATMIOC_PHYCOM	0x00-0x0f    PHY device common ioctls, globally unique
ATMIOC_PHYTYP	0x10-0x2f    PHY device type ioctls, unique per PHY type
  SONET_GETSTAT	    +0x00    include/linux/sonet.h	get SONET stats
  SONET_GETSTATZ    +0x01    include/linux/sonet.h	get SONET stats & zero
  SONET_SETDIAG	    +0x02    include/linux/sonet.h	set error insertion
  SONET_CLRDIAG	    +0x03    include/linux/sonet.h	clear error insertion
  SONET_GETDIAG	    +0x04    include/linux/sonet.h	query error insertion
  SONET_SETFRAMING  +0x05    include/linux/sonet.h	set framing mode
  SONET_GETFRAMING  +0x06    include/linux/sonet.h	get framing mode
  SONET_GETFRSENSE  +0x07    include/linux/sonet.h	get framing sense info
ATMIOC_PHYPRV	0x30-0x4f    PHY device private ioctls, unique per driver
  SUNI_GETLOOP	    +0x00    include/linux/atm_suni.h	get loopback mode
  SUNI_SETLOOP	    +0x01    include/linux/atm_suni.h	set loopback mode
ATMIOC_SARCOM	0x50-0x5f    SAR device common ioctls, globally unique
  ATM_GETSTAT	    +0x00    include/linux/atmdev.h	get itf stats
  ATM_GETSTATZ	    +0x01    include/linux/atmdev.h	get itf stats & zero
  ATM_GETLOOP       +0x02    include/linux/atmdev.h     get loopback mode
  ATM_SETLOOP       +0x03    include/linux/atmdev.h     set loopback mode
ATMIOC_SARPRV	0x60-0x7f    SAR device private ioctls, unique per driver
  ENI_MEMDUMP	    +0x00    include/linux/atm_eni.h	printk memory map
  ZATM_GETPOOL	    +0x01    include/linux/atm_zatm.h	get pool statistics
  ZATM_GETPOOLZ	    +0x02    include/linux/atm_zatm.h	... and zero
  ZATM_SETPOOL	    +0x03    include/linux/atm_zatm.h	set pool parameters
  ZATM_GETTHIST     +0x04    include/linux/atm_zatm.h	get timer drift history
  VIRATA_BOOT	    +0x05    drivers/atm/virata-atm.h	boot NIC image
  VIRATA_MISC	    +0x06    drivers/atm/virata-atm.h	miscellaneous operations
  ENI_SETMULT	    +0x07    include/linux/atm_eni.h	set buffer multipliers
  PCA200E_DUMP	    +0x1f    pca200e.h			dump card/driver status
ATMIOC_ITF	0x80-0x8f    Interface ioctls, globally unique
  SIOCSIFATMTCP	    +0x00    include/linux/atm_tcp.h	set ATMTCP mode
  ATM_GETLINKRATE   +0x01    include/linux/atmdev.h	get link rate
  reserved	    +0x02
  ATM_GETNAMES	    +0x03    include/linux/atmdev.h	get itf names (numbers)
  ATM_GETTYPE	    +0x04    include/linux/atmdev.h	get interface type name
  ATM_GETESI	    +0x05    include/linux/atmdev.h	get interface ESI
  ATM_GETADDR	    +0x06    include/linux/atmdev.h	get local ATM addresses
  ATM_RSTADDR	    +0x07    include/linux/atmdev.h	reset local ATM addr.
  ATM_ADDADDR	    +0x08    include/linux/atmdev.h	add local ATM address
  ATM_DELADDR	    +0x09    include/linux/atmdev.h	delete local ATM addr.
  ATM_GETCIRANGE    +0x0a    include/linux/atmdev.h     get conn. id. range
  ATM_SETCIRANGE    +0x0b    include/linux/atmdev.h     set conn. id. range
  ATM_SETESI	    +0x0c    include/linux/atmdev.h	set interface ESI
  ATM_SETESIF	    +0x0d    include/linux/atmdev.h	force interface ESI
  ATMTCP_CREATE     +0x0e    include/linux/atm_tcp.h    create persistent itf
  ATMTCP_REMOVE     +0x0f    include/linux/atm_tcp.h    remove persistent itf
		0x90-0xcf    Reserved for future use
ATMIOC_LANE	0xd0-0xd7    LAN Emulation
  ATMLEC_CTRL	    +0x00    include/linux/atmlec.h	LANE client ctrl socket
  ATMLEC_DATA	    +0x01    include/linux/atmlec.h	LEC data direct socket
  ATMLEC_MCAST	    +0x02    include/linux/atmlec.h	LEC multicast socket
ATMIOC_MPOA     0xd8-0xdf    Multi-Protocol Over ATM
  ATMMPC_CTRL       +0x00    include/linux/atmmpc.h     MPOA control socket
  ATMMPC_DATA       +0x01    include/linux/atmmpc.h     MPOA data socket
ATMIOC_CLIP	0xe0-0xef    Classical IP over ATM control, globally unique
  SIOCMKCLIP	    +0x00    include/linux/atmclip.h	create IP interface
  ATMARPD_CTRL	    +0x01    include/linux/atmarp.h	become arpd ctrl sock
  ATMARP_MKIP	    +0x02    include/linux/atmarp.h	attach socket to IP
  ATMARP_SETENTRY   +0x03    include/linux/atmarp.h	fill or hide ARP entry
  ATMARP_ENCAP	    +0x05    include/linux/atmarp.h	change encapsulation
ATMIOC_SPECIAL	0xf0-0xff    Special-purpose controls, globally unique
  ATMSIGD_CTRL	    +0x00    include/linux/atmsvc.h	become sigd ctrl sock
  ATM_SETSC	    +0x01    include/linux/atmdev.h	set single-copy
  reserved          +0x02

ioctls in different number spaces:

SIOCGSTAMP		include/asm/socket.h		get timestamp

Code points can be requested by e-mail from werner.almesberger@epfl.ch

For the distribution itself and related information, please see this page.


Werner Almesberger, 28-FEB-2000