Skip to content

Commit

Permalink
removed ndp tab again and prepaired ndp (and others) to be displayed …
Browse files Browse the repository at this point in the history
…in icmp6 tab
  • Loading branch information
Rup0rt committed Nov 11, 2013
1 parent a9a6326 commit 16135fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
4 changes: 2 additions & 2 deletions layer3.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GtkGrid *ipv4_grid(struct iphdr *ipv4, u_char *options); /* ipv4 (type 0x0800
GtkGrid *ipv6_grid(struct ip6_hdr *ipv6, u_char *options); /* ipv6 (type 0x08dd) */
GtkGrid *arp_grid(struct arphdr *arp, u_char *options); /* arp (type 0x0806) */
GtkGrid *icmp_grid(struct icmphdr *icmp, u_char *options, int left); /* icmp */
GtkGrid *icmpv6_grid(struct icmp6_hdr *icmpv6); /* icmp */
GtkGrid *icmpv6_grid(struct icmp6_hdr *icmpv6, u_char *options); /* icmp */

/**************************************************************************************************/

Expand Down Expand Up @@ -1297,7 +1297,7 @@ GtkGrid *icmp_grid(struct icmphdr *icmp, u_char *options, int left) {
return(grid);
}

GtkGrid *icmpv6_grid(struct icmp6_hdr *icmpv6) {
GtkGrid *icmpv6_grid(struct icmp6_hdr *icmpv6, u_char *options) {
GtkGrid *grid; /* the grid itself */
char *label; /* label of buttons to set */
int x,y; /* position pointer to next empty grid cell */
Expand Down
15 changes: 2 additions & 13 deletions netmate.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,7 @@ void display_packet(GtkWidget *widget) {
/* skip 4 bytes of unused / reserved fields of header struct and pass to next protocol pointer */
nextptr += sizeof(struct icmp6_hdr)-4;

gtk_notebook_append_page(protocolheadernotebook, GTK_WIDGET(icmpv6_grid(icmpv6)), gtk_label_new(ipprotocol(nextproto)));

/* neighbor discovery protocol? */
if ((icmpv6->icmp6_type >= 133) && (icmpv6->icmp6_type <= 137)) {
gtk_notebook_append_page(protocolheadernotebook, GTK_WIDGET(not_supported_grid(ethertype(nextproto))), gtk_label_new("NDP"));
}
gtk_notebook_append_page(protocolheadernotebook, GTK_WIDGET(icmpv6_grid(icmpv6, ((u_char*)nextptr))), gtk_label_new(ipprotocol(nextproto)));

break;
case IPPROTO_TCP:
Expand Down Expand Up @@ -405,7 +400,6 @@ void openpcapfile(GtkWidget *widget, gpointer data) {

void getinfo(pcap_t *handler, const u_char *packet, char **protocol, char **flags, char **source, char **sport, char **destination, char **dport) {
struct ether_header *eth;
struct icmp6_hdr *icmpv6;
struct iphdr *ipv4; /* ipv4_header pointer */
struct tcphdr *tcp;
struct udphdr *udp;
Expand Down Expand Up @@ -522,12 +516,7 @@ void getinfo(pcap_t *handler, const u_char *packet, char **protocol, char **flag

break;
case IPPROTO_ICMPV6:
icmpv6 = (struct icmp6_hdr*)nextptr;

/* neighbor discovery protocol? */
if ((icmpv6->icmp6_type >= 133) && (icmpv6->icmp6_type <= 137)) {
sprintf(*protocol, "%s", "NDP");
}
/* icmpv6 = (struct icmp6_hdr*)nextptr;*/

break;
case IPPROTO_TCP:
Expand Down

0 comments on commit 16135fa

Please sign in to comment.