示例#1
0
文件: main.c 项目: Beirdo/beirdobot
void LogBanner( void )
{
    LogPrintNoArg( LOG_CRIT, "beirdobot  (c) 2010 Gavin Hurlbut" );
    LogPrint( LOG_CRIT, "%s", git_version() );

    cursesTextAdd( WINDOW_HEADER, ALIGN_LEFT, 1, 0, "beirdobot" );
    cursesTextAdd( WINDOW_HEADER, ALIGN_LEFT, 11, 0, (char *)git_version() );
    cursesTextAdd( WINDOW_HEADER, ALIGN_FROM_CENTER, 1, 0, 
                   "(c) 2010 Gavin Hurlbut" );
    cursesTextAdd( WINDOW_TAILER, ALIGN_RIGHT, 1, 0, "Ctrl-C to exit" );
    cursesTextAdd( WINDOW_TAILER, ALIGN_LEFT, 1, 0, 
                   "Use arrow keys for menus" );
    cursesTextAdd( WINDOW_TAILER, ALIGN_CENTER, 0, 0, 
                   "PgUp/PgDn to scroll logs" );

    versionAdd( "beirdobot", (char *)git_version() );
}
示例#2
0
文件: bot.c 项目: Beirdo/beirdobot
char *ProcOnCTCP(BN_PInfo I, const char Who[], const char Whom[],
                 const char Type[])
{
    char           *S;

    if( verbose ) {
        LogPrint( LOG_DEBUG, "You (%s) have received a CTCP request from %s "
                             "(%s)", Whom, Who, Type);
    }

    S = NULL;

    if( !strcasecmp(Type, "version") ) {
        S = (char *)malloc(MAX_STRING_LENGTH);
        sprintf( S, "beirdobot -- %s", git_version() );
    }
    return S;
}
示例#3
0
/**
 * Code to handle the version option.
 *
 * @param[in] pOptions the tcpcapinfo options data structure
 * @param[in,out] pOptDesc the option descriptor for this option.
 */
static void
doOptVersion(tOptions* pOptions, tOptDesc* pOptDesc)
{
    /*
     * Be sure the flag-code[0] handles special values for the options pointer
     * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
     * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
     * reset its state.
     */
    /* extracted from tcpcapinfo_opts.def, line 99 */

    fprintf(stderr, "tcpcapinfo version: %s (build %s)", VERSION, git_version());
#ifdef DEBUG
    fprintf(stderr, " (debug)");
#endif
    fprintf(stderr, "\n");
    fprintf(stderr, "Copyright 2000-2010 by Aaron Turner <aturner at synfin dot net>\n");
    fprintf(stderr, "The entire Tcpreplay Suite is licensed under the GPLv3\n");
    exit(0);

    (void)pOptDesc;
    (void)pOptions;
}
示例#4
0
int uevent_dump_main(int argc, char *argv[])
{
    int opt;

    static struct option long_options[] = {
        {"help",      no_argument, 0, 'h'},
        {0, 0, 0, 0}
    };

    int long_index = 0;

    while ((opt = getopt_long(argc, argv, "h", long_options, &long_index)) != -1) {
        switch (opt) {
        case 'h':
            uevent_dump_usage(false);
            return EXIT_SUCCESS;
        default:
            uevent_dump_usage(true);
            return EXIT_FAILURE;
        }
    }

    // There should be no other arguments
    if (argc - optind != 0) {
        uevent_dump_usage(true);
        return EXIT_FAILURE;
    }

    LOGV("mbtool version %s (%s)", version(), git_version());

    // Start probing for devices
    device_init(true);
    // Kill uevent thread and close uevent socket
    device_close();

    return EXIT_SUCCESS;
}
示例#5
0
文件: import.c 项目: Beirdo/beirdobot
void LogBanner( void )
{
    LogPrintNoArg( LOG_CRIT, "importdb from beirdobot  "
                             "(c) 2010 Gavin Hurlbut" );
    LogPrint( LOG_CRIT, "%s", git_version() );
}