Beispiel #1
0
void shutdownCompleteNotif(unsigned int assocID, void* ulpDataPtr)
{
    sprintf(statusInfo, " Association ID =%-8x: Shutdown complete\n", assocID);
    waddstr(statusWin,statusInfo);
    wrefresh(statusWin);

    endwin();
    exit(0);

    /* delete the association, instance and terminate */
    sctp_deleteAssociation(assocID);
    sctp_unregisterInstance(sctpInstance);
    exit(0);
}
Beispiel #2
0
void shutdownCompleteNotif(unsigned int assocID, void* ulpDataPtr)
{
    if (verbose)
    {
      sprintf(tstr, "%-8x: Shutdown complete\n", assocID);
      waddstr(statusWin,tstr);
      wrefresh(statusWin);
    }

    /* delete the association */
    sctp_deleteAssociation(assocID);

    /* program terminates at this point upon the proper shutdown of the
       association. */
    endwin();
    exit(0);


}
Beispiel #3
0
int
SCTP_deleteAssociation(unsigned int associationID)
{
    int result;
    
    if ((result = sctp_deleteAssociation(associationID))!=0) {
        if (result == SCTP_LIBRARY_NOT_INITIALIZED) {
            fprintf(stderr, "sctp_deleteAssociation: library not initialized:\n");
        } else
        if (result == SCTP_SPECIFIC_FUNCTION_ERROR) {
            fprintf(stderr, "sctp_deleteAssociation: assoc not ready for deletion or lib not initialized:\n");
        } else
        if (result == SCTP_ASSOC_NOT_FOUND) {
            fprintf(stderr, "sctp_deleteAssociation: assoc does not exists.\n");
        }
        fflush(stderr);
    }
    return result;
}
Beispiel #4
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;
    unsigned char flags;
    void* ctx;


    sprintf(statusInfo, " Association ID =%-8x: Communication lost (status %u)\n", assocID, status);
    waddstr(statusWin,statusInfo);
    wrefresh(statusWin);

    return;

    /* retrieve data */
    bufferLength = sizeof(buffer);
    while (sctp_receiveUnsent(assocID, buffer, &bufferLength, &tsn,
                              &streamID, &streamSN, &protoID, &flags, &ctx) >= 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, &flags, &ctx) >= 0) {
        /* do something with the retrieved data */
        /* after that, reset bufferLength */
        bufferLength = sizeof(buffer);
    }

    /* delete the association, instace and terminate */
    sctp_deleteAssociation(assocID);
    sctp_unregisterInstance(sctpInstance);
    exit(0);
}
Beispiel #5
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;
    unsigned char flags;
    void * ctx;

    if (verbose) {
        sprintf(tstr, "%-8x: Communication lost (status %u)\n", assocID, status);
        waddstr(statusWin,tstr);
    }
    return;

    /* retrieve data */
    bufferLength = sizeof(buffer);
    while (sctp_receiveUnsent(assocID, buffer, &bufferLength, &tsn,
                              &streamID, &streamSN, &protoID, &flags, &ctx) >= 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, &flags, &ctx) >= 0){
        /* do something with the retrieved data */
        /* after that, reset bufferLength */
        bufferLength = sizeof(buffer);
    }

    /* delete the association */
    sctp_deleteAssociation(assocID);
}