[asterisk-dev] channel number on DAHDI channel ioctl-s

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sat Feb 14 12:06:13 CST 2009


On Sat, Feb 14, 2009 at 09:11:48AM -0600, Kevin P. Fleming wrote:
> Tzafrir Cohen wrote:
> 
> > Looking further, I noticed that all the ioctl operations in
> > dahdi_common_ioctl() (from dahdi_base.c) can accept the channel number
> > in two ways:
> > 
> > 1. The number from the channel for which it was called ("unit")
> > 2. An explicit channel number may be passed
> > 
> > What real use is there for (2)? Do we really want to let one channel
> > mess with others?
> 
> That would probably be used if the file descriptor passed to the
> function is actually a handle for /dev/dahdi/ctl, instead of a specific
> channel.

In that case the ioctl code should default to using 'unit' (the number
of the channel) and only use the number from userspace if unit is not
set (which means the ioctl was called on /dev/dahdi/ctl). Right?

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-dev mailing list