コード例 #1
0
ファイル: main.cpp プロジェクト: KasiR/NetworkSniffer
extern "C" DLL_EXPORT void SetupSniffer()
{
    RSSniffer = Sniffer();
}
コード例 #2
0
ファイル: dng_host.cpp プロジェクト: F0x06/Movie2DNG
void dng_host::SniffForAbort ()
	{
	
	dng_abort_sniffer::SniffForAbort (Sniffer ());
	
	}
コード例 #3
0
ファイル: main.c プロジェクト: DavidUser/CC3100
/*
 * Application's entry point
 */
int main( int argc, char *argv[] )
{
    _i32 channel = 0;
    _i32 numpackets = 0;
    _i32 retVal = -1;
    _i8 *pConfig = NULL;

    retVal = initializeAppVariables();
    ASSERT_ON_ERROR(retVal);

#ifdef SL_IF_TYPE_UART
    params.BaudRate = 115200;
    params.FlowControlEnable = 1;
    params.CommPort = COMM_PORT_NUM;

    pConfig = (_i8 *)&params;
#endif /* SL_IF_TYPE_UART */


    /*This line is for Eclipse CDT only due to a known bug in console buffering
     * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=173732 */
    setvbuf(stdout, NULL, _IONBF, 0);

    displayBanner();

    /*
     * Following function configures the device to default state by cleaning
     * the persistent settings stored in NVMEM (viz. connection profiles &
     * policies, power policy etc)
     *
     * Applications may choose to skip this step if the developer is sure
     * that the device is in its default state at start of application
     *
     * Note that all profiles and persistent settings that were done on the
     * device will be lost
     */
    retVal = configureSimpleLinkToDefaultState(pConfig);
    if(retVal < 0)
    {
        printf(" Failed to configure the device in its default state, Error code: %ld\r\n",retVal);
        LOOP_FOREVER();
    }

    printf("Device is configured in default state \r\n");

    /*
     * Assumption is that the device is configured in station mode already
     * and it is in its default state
     */
    retVal = sl_Start(0, pConfig, 0);
    if ((retVal < 0) ||
        (ROLE_STA != retVal) )
    {
        printf(" Failed to start the device, Error code: %ld\r\n",retVal);
        LOOP_FOREVER();
    }

    printf("Device is configured in default state \r\n");
    
    printf("Notes: There is at least a 0.5 second delay between each packet displayed.\n");
    printf("The command prompt can display a maximum of 50 packets.\n\n");
    printf("Please input desired channel number and click \"Enter\".\n");
    printf("Valid channels range from 1 to 13 (11 is standard): \n");
    fflush(stdin);
    scanf_s("%d",&channel, sizeof(channel));
    printf("Please input desired number of packets and click \"Enter\": \n");
    fflush(stdin);
    scanf_s("%d",&numpackets, sizeof(numpackets));
    retVal = Sniffer(channel, numpackets);
    if(retVal < 0)
        LOOP_FOREVER();

    system("PAUSE");

    return 0;
}