Beispiel #1
0
static void riot_ccn_express_interest(int argc, char **argv)
{
    static const char *default_interest = "/ccnx/0.7.1/doc/technical/CanonicalOrder.txt";

    if (argc < 2) {
        strncpy(small_buf, default_interest, 100); // null terminated
    }
    else {
        strncpy(small_buf, argv[1], 100);
    }

    DEBUG("in='%s'\n", small_buf);

    int content_len = ccnl_riot_client_get(relay_pid, small_buf, (char *) big_buf); // small_buf=name to request

    if (content_len == 0) {
        puts("riot_get returned 0 bytes...aborting!");
        return;
    }

    puts("####################################################");
    big_buf[content_len] = '\0';
    printf("data='%s'\n", big_buf);
    puts("####################################################");
    puts("done");
}
Beispiel #2
0
static void riot_ccn_express_interest(int argc, char **argv)
{
    if (argc < 2) {
        strncpy(small_buf, DEFAULT_INTEREST, sizeof(small_buf));
    }
    else {
        strncpy(small_buf, argv[1], sizeof(small_buf));
    }

    DEBUG("in='%s'\n", small_buf);

    int content_len = ccnl_riot_client_get(_relay_pid, small_buf, (char *) big_buf); // small_buf=name to request

    if (content_len == 0) {
        puts("riot_get returned 0 bytes...aborting!");
        return;
    }

    puts("####################################################");
    big_buf[content_len] = '\0';
    printf("data='%s'\n", big_buf);
    puts("####################################################");
    puts("done");
}