source: trunk/zoo-project/zoo-kernel/sshapi.h @ 974

Last change on this file since 974 was 917, checked in by djay, 6 years ago

Merge prototype-v0 branch in trunk

  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1/*
2 *
3 * Author : Gérald FENOY
4 *
5 *  Copyright 2017 GeoLabs SARL. All rights reserved.
6 *
7 * This work was supported by public funds received in the framework of GEOSUD,
8 * a project (ANR-10-EQPX-20) of the program "Investissements d'Avenir" managed
9 * by the French National Research Agency
10 *
11 * permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 * THE SOFTWARE.
28 */
29
30#ifndef SSHAPI_H
31#define SSHAPI_H 1
32
33#pragma once
34
35#include <libssh2.h>
36#include <libssh2_sftp.h>
37 
38#ifdef HAVE_WINSOCK2_H
39#include <winsock2.h>
40#endif
41#ifdef HAVE_SYS_SOCKET_H
42#include <sys/socket.h>
43#endif
44#ifdef HAVE_NETINET_IN_H
45#include <netinet/in.h>
46#endif
47#ifdef HAVE_SYS_SELECT_H
48#include <sys/select.h>
49#endif
50#ifdef HAVE_UNISTD_H
51#include <unistd.h>
52#endif
53#ifdef HAVE_ARPA_INET_H
54#include <arpa/inet.h>
55#endif
56#ifdef HAVE_SYS_TIME_H
57#include <sys/time.h>
58#endif
59
60#include <netdb.h>
61#include <arpa/inet.h>
62#include <sys/types.h>
63#include <fcntl.h>
64#include <errno.h>
65#include <stdio.h>
66#include <ctype.h>
67#include <time.h>
68
69#include "service.h"
70
71#ifdef __cplusplus
72extern "C" {
73#endif
74
75#define MAX_PARALLEL_SSH_CON 128 
76
77  static int nb_sessions;
78
79  typedef struct {
80    int sock_id;
81    int index;
82    LIBSSH2_SESSION *session;
83    LIBSSH2_SFTP *sftp_session;
84  } SSHCON;
85
86 
87  ZOO_DLL_EXPORT SSHCON *ssh_connect(maps*);
88  ZOO_DLL_EXPORT bool ssh_copy(maps*,const char*,const char*,int);
89  ZOO_DLL_EXPORT int ssh_get_cnt(maps*);
90  ZOO_DLL_EXPORT int ssh_fetch(maps*,const char*,const char*,int);
91  ZOO_DLL_EXPORT int ssh_exec(maps*,const char*,int);
92  ZOO_DLL_EXPORT bool ssh_close_session(maps*,SSHCON*);
93  ZOO_DLL_EXPORT bool ssh_close(maps*);
94  ZOO_DLL_EXPORT bool addToUploadQueue(maps**,maps*);
95  ZOO_DLL_EXPORT bool runUpload(maps**);
96 
97#ifdef __cplusplus
98}
99#endif
100
101#endif
Note: See TracBrowser for help on using the repository browser.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png