void shutdownCompleteNotif(unsigned int assocID, void* ulpDataPtr) { fprintf(fptr, "%-8x: Shutdown complete\n", assocID); fflush(fptr); /* free ULP data */ if (ulpDataPtr) ((struct ulp_data *) ulpDataPtr)->maximumStreamID = -1; SCTP_deleteAssociation(assocID); exit(0); }
void shutdownCompleteNotif(unsigned int assocID, void* ulpDataPtr) { if (verbose) { fprintf(stdout, "%-8x: Shutdown complete\n", assocID); fflush(stdout); } /* free ULP data */ free((struct ulp_data *) ulpDataPtr); SCTP_deleteAssociation(assocID); }
void shutdownCompleteNotif(unsigned int assocID, void* ulpDataPtr) { if (verbose) { fprintf(stdout, "%-8x: Shutdown complete\n", assocID); fflush(stdout); } /* delete the association, instance and terminate */ SCTP_deleteAssociation(assocID); SCTP_unregisterInstance((unsigned short)sctpInstance); exit(0); }
void shutdownCompleteNotif(unsigned int assocID, void* ulpDataPtr) { if (verbose) { fprintf(stdout, "%-8x: Shutdown complete\n", assocID); fprintf(stdout, "%ld messages of size %d received, (%llu bytes).\n", ((struct ulp_data *) ulpDataPtr)->nrOfReceivedChunks, firstLength, ((struct ulp_data *) ulpDataPtr)->nrOfReceivedBytes); fflush(stdout); } /* free ULP data */ ((struct ulp_data *) ulpDataPtr)->maximumStreamID = -1; SCTP_deleteAssociation(assocID); if (startAssociation) exit (0); firstLength = 0; }
void communicationLostNotif(unsigned int assocID, unsigned short status, void* ulpDataPtr) { unsigned char buffer[SCTP_MAXIMUM_DATA_LENGTH]; unsigned int bufferLength; unsigned short streamID, streamSN; unsigned int protoID; unsigned int tsn; if (verbose) { fprintf(stdout, "%-8x: Communication lost (status %u)\n", assocID, status); fflush(stdout); } /* retrieve data */ bufferLength = sizeof(buffer); while (SCTP_receiveUnsent(assocID, buffer, &bufferLength, &tsn, &streamID, &streamSN, &protoID) >= 0){ if (vverbose) { fprintf(stdout, "%-8x: Unsent data (%u bytes) retrieved (TSN = %u, SID = %u, SSN = %u, PPI = %u): %.*s", assocID, bufferLength, tsn, streamID, streamSN, protoID, bufferLength, buffer); fflush(stdout); } bufferLength = sizeof(buffer); } bufferLength = sizeof(buffer); while (SCTP_receiveUnacked(assocID, buffer, &bufferLength, &tsn, &streamID, &streamSN, &protoID) >= 0){ if (vverbose) { fprintf(stdout, "%-8x: Unacked data (%u bytes) retrieved (TSN = %u, SID = %u, SSN = %u, PPI = %u): %.*s", assocID, bufferLength, tsn, streamID, streamSN, protoID, bufferLength, buffer); fflush(stdout); } bufferLength = sizeof(buffer); } /* delete the association, instace and terminate */ SCTP_deleteAssociation(assocID); SCTP_unregisterInstance((unsigned short)sctpInstance); exit(0); }
void communicationLostNotif(unsigned int assocID, unsigned short status, void* ulpDataPtr) { unsigned char buffer[MAXIMUM_PAYLOAD_LENGTH]; unsigned int bufferLength; unsigned short streamID, streamSN; unsigned int protoID; unsigned int tsn; fprintf(fptr, "%-8x: Communication lost (status %u)\n", assocID, status); fflush(fptr); /* retrieve data */ bufferLength = sizeof(buffer); while (SCTP_receiveUnsent(assocID, buffer, &bufferLength, &tsn, &streamID, &streamSN, &protoID) >= 0){ /* do something with the retrieved data */ /* after that, reset bufferLength */ bufferLength = sizeof(buffer); } bufferLength = sizeof(buffer); while (SCTP_receiveUnacked(assocID, buffer, &bufferLength, &tsn, &streamID, &streamSN, &protoID) >= 0){ /* do something with the retrieved data */ /* after that, reset bufferLength */ bufferLength = sizeof(buffer); } /* free ULP data */ if (ulpDataPtr) { ((struct ulp_data *) ulpDataPtr)->maximumStreamID = -1; } /* delete the association */ SCTP_deleteAssociation(assocID); exit(0); }