File: addr_hash.h

package info (click to toggle)
iftop 1.0~pre4-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,072 kB
  • sloc: ansic: 5,782; sh: 4,262; makefile: 38
file content (33 lines) | stat: -rw-r--r-- 606 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * addr_hash.h:
 *
 */

#ifndef __ADDR_HASH_H_ /* include guard */
#define __ADDR_HASH_H_

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include "hash.h"

typedef struct {
    int af;
    unsigned short int protocol;
    unsigned short int src_port;
    union {
        struct in_addr src;
        struct in6_addr src6;
    };
    unsigned short int dst_port;
    union {
        struct in_addr dst;
        struct in6_addr dst6;
    };
} addr_pair;

typedef addr_pair key_type;      /* index into hash table */

hash_type* addr_hash_create(void);

#endif /* __ADDR_HASH_H_ */