SCTP Discussions

Text archives Help


Re: [SCTP-Discussion] adding new chunk type


Chronological Thread 
  • From: Michael Tuexen <Michael.Tuexen AT micmac.franken.de>
  • To: amar deka <amar_nitw2000 AT yahoo.co.in>
  • Cc: discussion AT sctp.de
  • Subject: Re: [SCTP-Discussion] adding new chunk type
  • Date: Tue Mar 22 01:12:02 2005
  • List-id: SCTP Discussions <discussion.sctp.de>

Hi,

this looks like that you want to implement something similar to
http://www.ietf.org/internet-drafts/draft-tuexen-sctp-auth-chunk-03.txt

Regarding the questions related the code we can only provide
support based on the API to the user as defined in sctp.h.

For additional things you have to use the source code. I'm sorry, but
I can not provide support for the sctplib source code. Possibly someone
else on the list can do this.

Best regards
Michael

On Mar 21, 2005, at 20:19 Uhr, amar deka wrote:

hi all
the terminal.c and echoserver.c progrms compiles and
runs but does not produce the intended output when we
modify the sctp implementation.

----->our intention was to add the HMAC of all the
chunks in the packet as an authentication chunk at the
end of the packet and to verify at the reciever.So we
sent a 20 byte string in an authentication chunk
defined by us

we defined a new chunk type in message.h as
#define CHUNK_AUTHENTICATION 0x11
#define AUTH_CHUNK_SIZE 24
.
.
in rbundling.c we modify the rbu_rcvDatagram()by
adding the following lines to the switch case

case CHUNK_AUTHENTICATION:
printf("AUTHENTICATION CHUNK
RECEIVED\n"); break;
.
.
.

we modified the sbundling.c in bu_sendAllChunks() as
follows to handle the new chunk type : the
modifications are marked with a >>

flag
.
if (bu_ptr->sack_in_buffer) {
rxc_stop_sack_timer();
/* SACKs by default go to the last active
address, from which data arrived */
send_len = bu_ptr->sack_position; /* at least
sizeof(SCTP_common_header) */
/* at most pointing to the end of SACK chunk
*/
event_logi(VVERBOSE, "bu_sendAllChunks(sack) :
send_len == %d ", send_len);
if (bu_ptr->ctrl_chunk_in_buffer) {
memcpy(&send_buffer[send_len],

&(bu_ptr->ctrl_buf[sizeof(SCTP_common_header)]),
(bu_ptr->ctrl_position -
sizeof(SCTP_common_header)));
send_len += bu_ptr->ctrl_position -
sizeof(SCTP_common_header);
event_logi(VVERBOSE,
"bu_sendAllChunks(sack+ctrl) : send_len == %d ",
send_len);
}
if (bu_ptr->data_in_buffer) {
flag=1;
memcpy(&send_buffer[send_len],

&(bu_ptr->data_buf[sizeof(SCTP_common_header)]),
(bu_ptr->data_position -
sizeof(SCTP_common_header)));
send_len += bu_ptr->data_position -
sizeof(SCTP_common_header);
event_logi(VVERBOSE,
"bu_sendAllChunks(sack+data) : send_len == %d ",
send_len);
}
} else if (bu_ptr->ctrl_chunk_in_buffer) {
send_len = bu_ptr->ctrl_position;
event_logi(VVERBOSE, "bu_sendAllChunks(ctrl) :
send_len == %d ", send_len);
if (bu_ptr->data_in_buffer) {
memcpy(&send_buffer[send_len],

&(bu_ptr->data_buf[sizeof(SCTP_common_header)]),
(bu_ptr->data_position -
sizeof(SCTP_common_header)));
send_len += bu_ptr->data_position -
sizeof(SCTP_common_header);
event_logi(VVERBOSE,
"bu_sendAllChunks(ctrl+data) : send_len == %d ",
send_len);
}


} else if (bu_ptr->data_in_buffer)
{
send_len = bu_ptr->data_position;
flag=1;
}




event_logi(VVERBOSE, "bu_sendAllChunks(finally) :
send_len == %d ", send_len);


if(flag)
{
simpleChunk = (SCTP_simple_chunk *)
malloc(sizeof(SCTP_simple_chunk));

memset(simpleChunk, 0,
sizeof(SCTP_simple_chunk));


simpleChunk->chunk_header.chunk_id =
CHUNK_AUTHENTICATION;
simpleChunk->chunk_header.chunk_flags=0x02;
simpleChunk->chunk_header.chunk_length =
AUTH_CHUNK_SIZE;



memcpy(simpleChunk->simple_chunk_data,temp_buffer,AUTH_CHUNK_SIZE-4);

memcpy(&send_buffer[send_len],(char*)simpleChunk,AUTH_CHUNK_SIZE);
send_len += AUTH_CHUNK_SIZE;
printf("adding authentication data:\n");
flag=0;
}

we modified the if condition in the functions
bu_put_ctrl_chunk,bu_put_dat_chunk and
bu_put_sack_chunk of sbundler.c


if (TOTAL_SIZE(bu_ptr) +
CHUNKP_LENGTH((SCTP_chunk_header *) chunk) >=
MAX_SCTP_PDU-AUTH_CHUNK_SIZE)

the problem is that when i run the echoserver and
terminal programs the data from the client reaches to
the server but the data is not transmitted back to the
client(this i found out through some print statements)

what could be the problem.If possible please suggest
some methods to deal with the problem.


Thankyou for taking time to read the mail.

amar



_______________________________________________________________________ _
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
_______________________________________________
discussion mailing list
discussion AT sctp.de
http://www.sctp.de/mailman/listinfo/discussion






Archive powered by MHonArc 2.6.19+.

Top of page