]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bsock.h
Update projects
[bacula/bacula] / bacula / src / lib / bsock.h
index 5ba9877fd42bd25e6df61d62db3a2c80736d1179..fa4a6c46d90e98e1a985cbaa0394eaae2dfd28b7 100644 (file)
@@ -36,9 +36,11 @@ struct BSOCK {
    uint32_t in_msg_no;                /* input message number */
    uint32_t out_msg_no;               /* output message number */
    int fd;                            /* socket file descriptor */
+   TLS_CONNECTION *tls;               /* associated tls connection */
    int32_t msglen;                    /* message length */
    int b_errno;                       /* bsock errno */
    int port;                          /* desired port */
+   int blocking;                      /* blocking state (0 = nonblocking, 1 = blocking) */
    volatile int errors;               /* incremented for each error on socket */
    volatile bool suppress_error_msgs: 1; /* set to suppress error messages */
    volatile bool timed_out: 1;        /* timed out in read/write */
@@ -50,13 +52,13 @@ struct BSOCK {
    POOLMEM *msg;                      /* message pool buffer */
    char *who;                         /* Name of daemon to which we are talking */
    char *host;                        /* Host name/IP */
-   POOLMEM *errmsg;                   /* edited error message (to be implemented) */
+   POOLMEM *errmsg;                   /* edited error message */
    RES *res;                          /* Resource to which we are connected */
    BSOCK *next;                       /* next BSOCK if duped */
    FILE *spool_fd;                    /* spooling file */
    JCR *jcr;                          /* jcr or NULL for error msgs */
-   struct sockaddr_in client_addr;    /* client's IP address */
-};      
+   struct sockaddr client_addr;    /* client's IP address */
+};
 
 /* Signal definitions for use in bnet_sig() */
 enum {
@@ -80,10 +82,13 @@ enum {
 #define BNET_HARDEOF -2
 #define BNET_ERROR   -3
 
-/* SSL enabling values */
-#define BNET_SSL_NONE     0           /* cannot do SSL */
-#define BNET_SSL_OK       1           /* can do, but not required on my end */
-#define BNET_SSL_REQUIRED 2           /* SSL is required */
+/*
+ * TLS enabling values. Value is important for comparison, ie:
+ * if (tls_remote_need < BNET_TLS_REQUIRED) { ... }
+ */
+#define BNET_TLS_NONE     0           /* cannot do TLS */
+#define BNET_TLS_OK       1           /* can do, but not required on my end */
+#define BNET_TLS_REQUIRED 2           /* TLS is required */
 
 /*
  * This is the structure of the in memory BPKT
@@ -95,11 +100,11 @@ typedef struct s_bpkt {
    void *value;                       /* pointer to value */
 } BPKT;
 
-/*  
+/*
  * These are the data types that can be sent.
  * For all values other than string, the storage space
  *  is assumed to be allocated in the receiving packet.
- *  For BP_STRING if the *value is non-zero, it is a        
+ *  For BP_STRING if the *value is non-zero, it is a
  *  pointer to a POOLMEM buffer, and the Memory Pool
  *  routines will be used to assure that the length is
  *  adequate. NOTE!!! This pointer will be changed