197
200
new_packet_length += ret;
201
fprintf(stderr, "decrypted password is: %s\n", *new_packet);
204
/* Delete the GPGME plaintext data buffer */
203
/* FIXME: check characters before printing to screen so to not print
204
terminal control characters */
206
/* fprintf(stderr, "decrypted password is: "); */
207
/* fwrite(*new_packet, 1, new_packet_length, stderr); */
208
/* fprintf(stderr, "\n"); */
211
/* Delete the GPGME plaintext data buffer */
205
212
gpgme_data_release(dh_plain);
206
213
return new_packet_length;
321
328
size_t buffer_capacity = 0;
322
329
ssize_t decrypted_buffer_size;
324
const char interface[] = "eth0";
327
333
fprintf(stderr, "Setting up a tcp connection to %s\n", ip);
552
558
int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
553
559
AvahiServerConfig config;
554
560
AvahiSServiceBrowser *sb = NULL;
555
const char db[] = "--debug";
558
563
int returncode = EXIT_SUCCESS;
559
char *basename = rindex(argv[0], '/');
560
if(basename == NULL){
566
char *program_name = malloc(strlen(basename) + sizeof(db));
568
if (program_name == NULL){
573
program_name[0] = '\0';
575
for (int i = 1; i < argc; i++){
576
if (not strncmp(argv[i], db, 5)){
577
strcat(strcat(strcat(program_name, db ), "="), basename);
578
if(not strcmp(argv[i], db) or not strcmp(argv[i], program_name)){
566
static struct option long_options[] = {
567
{"debug", no_argument, (int *)&debug, 1},
568
{"interface", required_argument, 0, 'i'},
571
int option_index = 0;
572
ret = getopt_long (argc, argv, "i:", long_options, &option_index);
586
590
avahi_set_log_function(empty_log);