GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Nov 01, 2014 2:01 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: regarding neat
PostPosted: Tue Jan 02, 2007 12:35 pm 
Offline
GTK+ Guru

Joined: Thu Nov 16, 2006 5:08 am
Posts: 259
Location: INDIA
hi everyone
happy new year to all
i got a problem
terminal->neat

it will open Network Configuration window

in this 2 buttons Activate and Deactivate are there

how can i use these buttons in my program

am doing the same example
am taking two buttons named as same
how can i do activate and deactivate operations without using neat

where these signals stores in my system F4

i hope you can understand my problem
please show me the way

thank you in advance


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 02, 2007 7:18 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
I'm sorry, I don't understand...

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject: thank you
PostPosted: Wed Jan 03, 2007 5:01 am 
Offline
GTK+ Guru

Joined: Thu Nov 16, 2006 5:08 am
Posts: 259
Location: INDIA
how can i know wether the net is activated or deactivated in programatically

thank you


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 03, 2007 5:34 am 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
Well, I'm not really sure. Perhaps you can use SMB or something... either the net_lookup or parse the output of the "net lookup" command? It'll return -1 if it can't resolve the host and 0 if it succeeds.

I'll play around with it later... but now I'm off to the movies.

[/code]

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 03, 2007 8:04 am 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
Try this:

Code:
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>

int can_resolve_host (const char *host)
{
   struct hostent *h = NULL;
    h = gethostbyname (host);
   
    if (h == NULL)
    {
          return -1;
    }
    else
    {
       return 0;
    }
}

int main(int argc, char **argv)
{
    if (can_resolve_host ("google.com") == -1)
    {
       printf ("Failed to reach google.com\n");
    }
    else
    {
       printf ("Successfully reached google.com\n");   
    }
   
    return 0;
}

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject: thank you
PostPosted: Wed Jan 03, 2007 10:03 am 
Offline
GTK+ Guru

Joined: Thu Nov 16, 2006 5:08 am
Posts: 259
Location: INDIA
its amazing.
thank you Micah Carrick
.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 03, 2007 6:17 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
Sure. More details about the struct that does return (list of IPs, etc) can be found by typing 'man gethostname'

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject: hi
PostPosted: Tue Feb 20, 2007 1:22 pm 
Offline

Joined: Tue Feb 20, 2007 12:25 pm
Posts: 2
yeam using this code.

it is very usefull.

when i remove the cable the code not working

can u please advise me

thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group