Skip to content

Commit

Permalink
Move struct socket_info in socket_info.h
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Apr 17, 2018
1 parent a0373e5 commit b723bd9
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
23 changes: 0 additions & 23 deletions ip_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ struct ip_addr{
};



struct net{
struct ip_addr ip;
struct ip_addr mask;
Expand All @@ -85,28 +84,6 @@ union sockaddr_union{
enum si_flags { SI_NONE=0, SI_IS_IP=1, SI_IS_LO=2, SI_IS_MCAST=4,
SI_IS_ANYCAST=8 };

struct socket_info {
int socket;
str name; /*!< name - eg.: foo.bar or 10.0.0.1 */
struct ip_addr address; /*!< ip address */
str address_str; /*!< ip address converted to string -- optimization*/
unsigned short port_no; /*!< port number */
str port_no_str; /*!< port number converted to string -- optimization*/
enum si_flags flags; /*!< SI_IS_IP | SI_IS_LO | SI_IS_MCAST | SI_IS_ANYCAST */
union sockaddr_union su;
int proto; /*!< tcp or udp*/
str sock_str;
str adv_sock_str;
str adv_name_str; /* Advertised name of this interface */
str adv_port_str; /* Advertised port of this interface */
struct ip_addr adv_address; /* Advertised address in ip_addr form (for find_si) */
unsigned short adv_port; /* optimization for grep_sock_info() */
unsigned short children;
struct socket_info* next;
struct socket_info* prev;
};


struct receive_info {
struct ip_addr src_ip;
struct ip_addr dst_ip;
Expand Down
1 change: 1 addition & 0 deletions modules/presence/utils_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <string.h>
#include "../../mem/mem.h"
#include "../../dprint.h"
#include "../../socket_info.h"
#include "../../str.h"
#include "../../parser/msg_parser.h"

Expand Down
1 change: 1 addition & 0 deletions modules/usrloc/ucontact.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "../../qvalue.h"
#include "../../str.h"
#include "../../proxy.h"
#include "../../socket_info.h"
#include "../../db/db_insertq.h"


Expand Down
1 change: 1 addition & 0 deletions msg_translator.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

#include "parser/msg_parser.h"
#include "ip_addr.h"
#include "socket_info.h"
#include "context.h"
#include "globals.h"

Expand Down
22 changes: 21 additions & 1 deletion socket_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,27 @@
#include "globals.h"
#include "net/trans.h"
#include "ut.h"
/* struct socket_info is defined in ip_addr.h */

struct socket_info {
int socket;
str name; /*!< name - eg.: foo.bar or 10.0.0.1 */
struct ip_addr address; /*!< ip address */
str address_str; /*!< ip address converted to string -- optimization*/
unsigned short port_no; /*!< port number */
str port_no_str; /*!< port number converted to string -- optimization*/
enum si_flags flags; /*!< SI_IS_IP | SI_IS_LO | SI_IS_MCAST | SI_IS_ANYCAST */
union sockaddr_union su;
int proto; /*!< tcp or udp*/
str sock_str;
str adv_sock_str;
str adv_name_str; /* Advertised name of this interface */
str adv_port_str; /* Advertised port of this interface */
struct ip_addr adv_address; /* Advertised address in ip_addr form (for find_si) */
unsigned short adv_port; /* optimization for grep_sock_info() */
unsigned short children;
struct socket_info* next;
struct socket_info* prev;
};

#define NUM_IP_OCTETS 4
#define PROTO_NAME_MAX_SIZE 8 /* CHANGEME if you define a bigger protocol name
Expand Down

0 comments on commit b723bd9

Please sign in to comment.