Transparent ioctls Streams calls


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Transparent ioctls Streams calls
# 1  
Old 05-24-2002
Transparent ioctls Streams calls

What are transparent ioctls messages and when and why we have to issue copyin or copyout kernel utilities with respect to ioctls calls to a Stream.
# 2  
Old 05-28-2002
This mechanism is needed because user context does not exist in modules and drivers when ioctl processing occurs. This prevents them from using the kernel itself on copyin and copyout functions
consider the following ioctl call:

ioctl (stream_fildes, user_command, &ioctl_struct);

where ioctl_struct is a structure containing the members:
int stringlen; /* string length */
char *string;
struct other_struct *other1;

To read (or write) the elements of ioctl_struct, a module would have to do a series of copyin( ) and copyout( ) calls using pointer information from a prior copyin( ) to transfer additional data. A non-STREAMS character driver could directly execute these copy functions because user context exists during all calls to the driver. However, in STREAMS, user context is only available to modules and drivers in their open( ) and close( ) routines.
The transparent mechanism enables modules and drivers to request that the Stream head do a copyin( ) or copyout( ) operation on their behalf to transfer ioctl data between their kernel space and various user space locations. The related data is sent in message pairs exchanged between the Stream head and the module. A pair of messages is required so that each transfer can be acknowledged.
# 3  
Old 05-31-2002
Transparent Ioctls in Streams

Thanks a ton for your reply. What I understood that the u area is outside the scope of Stream's module except to its open and close modules.

By stating "The related data is sent in message pairs exchanged between the Stream head and the module. A pair of messages is required so that each transfer can be acknowledged." - did you mean to say that :
*mblk_t->b_cont->b_rptr == *mblk_t->b_rptr ie data buffer content is same(2 Copies of data is there ) or
mblk_t->b_cont = dupb ( mblk_t )
ie mblk_t->b_datap == mblk_t->b_cont->b_datab . Kindly clarify. While transferring data from kernel space to user or vice versa the first message block is responsible for populating the ioctl's request's response as M_COPYIN or M_COPYOUT (mblk_t->b_datap->db_type member = M_COPYIN or M_COPYOUT)
Sir, does it then means that cq_addr and cq_size of copyreq structure identifies the data and its size in the user space.
Sir , kindly also guide me on the fact that if the command type is I_STR for an input / output operation on a Stream - is it that, at the timeout interval specified in ic_timout member of strioctl structure, the stream device itself responds with ETIME error . The Stream knows how to process the internal ioctl command type and loops the message block into the queue of itself.

Last edited by S.P.Prasad; 06-06-2002 at 07:41 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. OS X (Apple)

OSX Sierra transparent shell audio sampler.

Well after the transparent QuickTime Player means of capture for OSX 10.7.x became broken in at least Yosemite I decided to persevere with a version of command line capture for OSX 10.12.x. A derivative of this DEMO is now inside AudioScope.sh to give my MBP and iMac a means of capturing an... (3 Replies)
Discussion started by: wisecracker
3 Replies

2. IP Networking

Transparent Proxy with URL Rewriting

All traffic on the LAN is routed through a single machine and filtered using iptables. I'd like to redirect this traffic to a transparent proxy running on the same machine that will rewrite the URL if it matches a specified regex, in which case the user will be redirected to a local server. In... (0 Replies)
Discussion started by: crottyan
0 Replies

3. Ubuntu

Vlc transparent

I'm I able to make vlc or mplayer transparent. If so how can i do it please. thanks in advance josh (0 Replies)
Discussion started by: jtsmith90
0 Replies

4. UNIX for Dummies Questions & Answers

Transparent compression and encryption

in windows you can encrypt and compress file via it properties. It compress the file in a way that is transparent, I mean you do know that it is compressed, but you can work with it as if it is not, you don't need to decompress it in order to edit it or watch it. The same go for encryption as... (0 Replies)
Discussion started by: programAngel
0 Replies

5. Virtualization and Cloud Computing

Invisible/Transparent Background in VM

Hello, If you switch to "seamless mode" in virtualbox, you can see the taskbar of the OS on your screen , like having a transparent background on your VM. My question: is there a possibility to do the same in VMware's Workstation (7) ? I know and use the "Unity" mode in Workstation/Player, but... (0 Replies)
Discussion started by: al0x
0 Replies

6. IP Networking

SQUID Transparent Proxy Server

hi guys! We are setting up Squid Server. we want the server to be transparent. But I don't know how will i be able to set the network up. is it possible to set the squid server in the same LAN with the Squid Client and still functions as a transparent server? if so, can anybody help me do it? ... (1 Reply)
Discussion started by: init6_
1 Replies

7. IP Networking

Identification of data calls & voice calls

Is there any facility to filter/identify the data calls and voice calls coming throug modem? OR Can we get the data or voice calls information through a script(preferably C Kermit)? (0 Replies)
Discussion started by: pcsaji
0 Replies

8. Cybersecurity

IPNAT / Transparent proxy loops...

Hi! My situation: I have an OpenBSD firewall/proxy (192.168.0.1), running IPF/IPNAT w/ Squid as transparent proxy. This machine is configured to be gateway to the network. This works great, all the clients WWW-requests on the internal network are rerouted to the proxyport by this... (0 Replies)
Discussion started by: indo1144
0 Replies

9. Shell Programming and Scripting

How to make my xterm transparent

I just want to make my xterm to be transparent, but I don't know how, could somebody tell me? :( (3 Replies)
Discussion started by: zhiyuan
3 Replies
Login or Register to Ask a Question