[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(usagi-users 03046) setting the traffic class



Hello sirs,

I've been trying to set the traffic class in an easy TCP
server/client program.
I have succeeded to set it in the client packet, but not
in the packet that server send out after accepting a
connection from the client.


This is roughly how I tried.

Client program:

/* create a socket */
s = socket(...);

/* set socket option to sentout flowinfo */
setsockopt(...,IPPROTO_IPV6, IPV6_FLOWINFO_SEND, &on, sizeof(on));

/* set the traffic class */
server_addr.sin6_flowinfo = htonl((0x44&0xFF) << 20);

/* connect to server */
connect(...);

/* on we go */
send(...);


Server program:

/* create a socket */
s = socket(...);

/* set socket option to sentout flowinfo */
setsockopt(...,IPPROTO_IPV6, IPV6_FLOWINFO_SEND, &on, sizeof(on));

/* set the traffic class */
server_addr.sin6_flowinfo = htonl((0x24&0xFF) << 20);

/* bind to whatever port I want */
bind(...);

/* get the queues ready */
listen(...);

/* all set */
accept(...);

/* receive packets */
recv(...);

/* send back the message(and set 0x24 for traffic class) */
send(...);


I thought I would get the packet with 0x24 traffic class, but
unfortunately, didnt.(It was set to 0x00 according to ethereal)
I'd appreciate you wizards help.
And one thing, I didnt really want to use the IPV6_TCLASS since
it only works on USAGI.(wanted to use it on the normal kernel
too)

Thanks in advence,
Eme


-- 
Hideaki Nemoto <eme@xxxxxxxxxxxxxxx>