Subversion Repositories Spectranet

[/] [trunk/] [tnfs/] [tnfsd/] [datagram.h] - Blame information for rev 570

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 291 winston
#ifndef _DATAGRAM_H
2
#define _DATAGRAM_H
3
 
4
/* The MIT License;
5
 * Copyright (c) 2010 Dylan Smith
6
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7
 * of this software and associated documentation files (the "Software"), to deal
8
 * in the Software without restriction, including without limitation the rights
9
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
 * copies of the Software, and to permit persons to whom the Software is
11
 * furnished to do so, subject to the following conditions:
12
 *
13
 * The above copyright notice and this permission notice shall be included in
14
 * all copies or substantial portions of the Software.
15
 *
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
 * THE SOFTWARE.
23
 *
24
 * TNFS daemon datagram handler
25
 *
26
 * */
27
 
28
#include <sys/types.h>
29 299 winston
 
30
#ifdef UNIX
31 291 winston
#include <arpa/inet.h>
32 299 winston
#endif
33 291 winston
 
34 299 winston
#ifdef WIN32
35
#include <windows.h>
36
#endif
37
 
38
#ifndef in_addr_t
39
#define in_addr_t uint32_t
40
#endif
41
 
42 291 winston
#include "tnfs.h"
43
 
44
/* Handle the socket interface */
45
void tnfs_sockinit();
46
void tnfs_mainloop();
47 570 winston
void tnfs_handle_udpmsg();
48
void tcp_accept(int *fdlist);
49
void tnfs_handle_tcpmsg(int cli_fd);
50 291 winston
void tnfs_decode(struct sockaddr_in *cliaddr,
51
                int rxbytes, unsigned char *rxbuf);
52
void tnfs_badcommand(Header *hdr, Session *sess);
53
void tnfs_send(Session *sess, Header *hdr, unsigned char *msg, int msgsz);
54
void tnfs_resend(Session *sess, struct sockaddr_in *cliaddr);
55
 
56
#endif