public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: Christine Caulfield <chrissie@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: cluster: STABLE2 - dlm: Allow dlm_tcpdump & dlmtop to select network interface Date: Wed, 20 May 2009 15:10:00 -0000 [thread overview] Message-ID: <20090520151005.3AA871201EC@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=32467b220a4bf6aa08eb861d3595b860572cf5f3 Commit: 32467b220a4bf6aa08eb861d3595b860572cf5f3 Parent: bce26b94b8598ee7fa14df49f79980af3b548cd9 Author: Christine Caulfield <ccaulfie@redhat.com> AuthorDate: Wed May 20 16:09:32 2009 +0100 Committer: Christine Caulfield <ccaulfie@redhat.com> CommitterDate: Wed May 20 16:09:32 2009 +0100 dlm: Allow dlm_tcpdump & dlmtop to select network interface Signed-off-by: Christine Caulfield <ccaulfie@redhat.com> --- dlm/tests/tcpdump/dlm_tcpdump.c | 10 ++++++++-- dlm/tests/tcpdump/dlmtop.c | 16 +++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/dlm/tests/tcpdump/dlm_tcpdump.c b/dlm/tests/tcpdump/dlm_tcpdump.c index 6953aef..ab7a162 100644 --- a/dlm/tests/tcpdump/dlm_tcpdump.c +++ b/dlm/tests/tcpdump/dlm_tcpdump.c @@ -10,6 +10,7 @@ * v0.4 Add RHEL5 support(untested) * v0.5 Fix bug that caused us to loop if length was zero (why??) * v0.6 Show full command-line and timestamps (djuran) +* v0.7 Allow ethernet interface to be set via command-line * **********************************************************************/ @@ -335,11 +336,16 @@ int main(int argc,char **argv) signal(SIGINT, finish_up); - /* has table for lock info */ + /* hash table for lock info */ hcreate(100000); /* grab a device to peak into... */ - dev = pcap_lookupdev(errbuf); + if (argc>1) { + dev=argv[1]; + } else { + dev = pcap_lookupdev(errbuf); + } + if(dev == NULL) { fprintf(stderr,"%s\n",errbuf); exit(1); } diff --git a/dlm/tests/tcpdump/dlmtop.c b/dlm/tests/tcpdump/dlmtop.c index 1698c06..df06eb9 100644 --- a/dlm/tests/tcpdump/dlmtop.c +++ b/dlm/tests/tcpdump/dlmtop.c @@ -533,6 +533,7 @@ static void usage(char *cmd, FILE *f) fprintf(f, " -l Sort by lock operations (default)\n"); fprintf(f, " -a Show accumulated counters rather than per <interval> operations\n"); fprintf(f, " -i <secs> Set the refresh interval (default 1 second)\n"); + fprintf(f, " -I <name> Select the network interface to listen on)\n"); fprintf(f, " -p <port> Change the TCP port to listen on (default 21064)\n"); fprintf(f, " -d[ddd] Enable/increase debugging messages to stderr\n"); fprintf(f, " -h Show this help message\n"); @@ -541,7 +542,7 @@ static void usage(char *cmd, FILE *f) int main(int argc,char **argv) { - char *dev; + char *dev=NULL; char errbuf[PCAP_ERRBUF_SIZE]; char bpf_text[132]; pcap_t* descr; @@ -553,7 +554,7 @@ int main(int argc,char **argv) /* Deal with command-line arguments */ opterr = 0; optind = 0; - while ((opt=getopt(argc,argv,"?hVrladi:p:")) != EOF) + while ((opt=getopt(argc,argv,"?hVrladi:p:I:")) != EOF) { switch(opt) { @@ -579,6 +580,9 @@ int main(int argc,char **argv) sprintf(bpf_text, "port %d", atoi(optarg)); dlm_filter = bpf_text; break; + case 'I': + dev = strdup(optarg); + break; case 'd': debug++; break; @@ -609,9 +613,11 @@ int main(int argc,char **argv) memset(remote_procs, 0, sizeof(remote_procs)); /* grab a device to peek into... */ - dev = pcap_lookupdev(errbuf); - if(dev == NULL) - { fprintf(stderr,"%s\n",errbuf); exit(1); } + if (!dev) { + dev = pcap_lookupdev(errbuf); + if(dev == NULL) + { fprintf(stderr,"%s\n",errbuf); exit(1); } + } /* open device for reading this time lets set it in promiscuous * mode so we can monitor traffic to another machine */
reply other threads:[~2009-05-20 15:10 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090520151005.3AA871201EC@lists.fedorahosted.org \ --to=chrissie@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).