r23792: convert Samba4 to GPLv3
[samba.git] / source4 / lib / socket / socket.h
index 04ae53e464530e481438fd914665f777c923d758..6bc03188a56e1d14a331bf4081d80d6c7cd89047 100644 (file)
@@ -5,7 +5,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #ifndef _SAMBA_SOCKET_H
@@ -102,6 +101,15 @@ enum socket_state {
 #define SOCKET_FLAG_BLOCK        0x00000001
 #define SOCKET_FLAG_PEEK         0x00000002
 #define SOCKET_FLAG_TESTNONBLOCK 0x00000004
+#define SOCKET_FLAG_ENCRYPT      0x00000008 /* This socket
+                                            * implementation requires
+                                            * that re-sends be
+                                            * consistant, because it
+                                            * is encrypting data.
+                                            * This modifies the
+                                            * TESTNONBLOCK case */
+#define SOCKET_FLAG_NOCLOSE      0x00000010 /* don't auto-close on free */
+
 
 struct socket_context {
        enum socket_type type;
@@ -117,6 +125,9 @@ struct socket_context {
 
 
 /* prototypes */
+NTSTATUS socket_create_with_ops(TALLOC_CTX *mem_ctx, const struct socket_ops *ops,
+                               struct socket_context **new_sock, 
+                               enum socket_type type, uint32_t flags);
 NTSTATUS socket_create(const char *name, enum socket_type type, 
                       struct socket_context **new_sock, uint32_t flags);
 NTSTATUS socket_connect(struct socket_context *sock,
@@ -186,5 +197,6 @@ NTSTATUS socket_connect_multi(TALLOC_CTX *mem_ctx, const char *server_address,
                              struct socket_context **result,
                              uint16_t *port);
 void set_socket_options(int fd, const char *options);
+void socket_set_flags(struct socket_context *socket, unsigned flags);
 
 #endif /* _SAMBA_SOCKET_H */