/[monit]/monit/protocols/protocol.c
ViewVC logotype

Diff of /monit/protocols/protocol.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by chopp, Mon Aug 26 16:28:40 2002 UTC revision 1.6 by hauk, Mon Nov 25 17:00:38 2002 UTC
# Line 36  static Protocol_T mysmtp= NULL; Line 36  static Protocol_T mysmtp= NULL;
36  static Protocol_T mypop= NULL;  static Protocol_T mypop= NULL;
37  static Protocol_T myimap= NULL;  static Protocol_T myimap= NULL;
38  static Protocol_T mynntp= NULL;  static Protocol_T mynntp= NULL;
39    static Protocol_T myssh= NULL;
40    
41    
42  /**  /**
# Line 62  void gc_protocols() { Line 63  void gc_protocols() {
63    free(mypop);     mypop= NULL;    free(mypop);     mypop= NULL;
64    free(myimap);    myimap= NULL;    free(myimap);    myimap= NULL;
65    free(mynntp);    mynntp= NULL;    free(mynntp);    mynntp= NULL;
66      free(myssh);     myssh= NULL;
67    
68  }  }
69    
70    
71  void *create_default() {  void *create_default() {
72    
73    if ( mydefault == NULL ) {    if(mydefault == NULL) {
74      static const char *name= "DEFAULT";      static const char *name= "DEFAULT";
75      mydefault= NEW(mydefault);      mydefault= NEW(mydefault);
76      mydefault->name= name;      mydefault->name= name;
# Line 82  void *create_default() { Line 84  void *create_default() {
84    
85  void *create_http() {  void *create_http() {
86    
87    if ( myhttp == NULL ) {    if(myhttp == NULL) {
88      static const char *name= "HTTP";      static const char *name= "HTTP";
89      myhttp= NEW(myhttp);      myhttp= NEW(myhttp);
90      myhttp->name= name;      myhttp->name= name;
# Line 96  void *create_http() { Line 98  void *create_http() {
98    
99  void *create_ftp() {  void *create_ftp() {
100    
101    if ( myftp == NULL ) {    if(myftp == NULL) {
102      static const char *name= "FTP";      static const char *name= "FTP";
103      myftp= NEW(myftp);      myftp= NEW(myftp);
104      myftp->name= name;      myftp->name= name;
# Line 110  void *create_ftp() { Line 112  void *create_ftp() {
112    
113  void *create_smtp() {  void *create_smtp() {
114    
115    if ( mysmtp == NULL ) {    if(mysmtp == NULL) {
116      static const char *name= "SMTP";      static const char *name= "SMTP";
117      mysmtp= NEW(mysmtp);      mysmtp= NEW(mysmtp);
118      mysmtp->name= name;      mysmtp->name= name;
# Line 124  void *create_smtp() { Line 126  void *create_smtp() {
126    
127  void *create_pop() {  void *create_pop() {
128    
129    if ( mypop == NULL ) {    if(mypop == NULL) {
130      static const char *name= "POP";      static const char *name= "POP";
131      mypop= NEW(mypop);      mypop= NEW(mypop);
132      mypop->name= name;      mypop->name= name;
# Line 138  void *create_pop() { Line 140  void *create_pop() {
140    
141  void *create_imap() {  void *create_imap() {
142    
143    if ( myimap == NULL ) {    if(myimap == NULL) {
144      static const char *name= "IMAP";      static const char *name= "IMAP";
145      myimap= NEW(myimap);      myimap= NEW(myimap);
146      myimap->name= name;      myimap->name= name;
# Line 152  void *create_imap() { Line 154  void *create_imap() {
154    
155  void *create_nntp() {  void *create_nntp() {
156    
157    if ( mynntp == NULL ) {    if(mynntp == NULL) {
158      static const char *name= "NNTP";      static const char *name= "NNTP";
159      mynntp= NEW(mynntp);      mynntp= NEW(mynntp);
160      mynntp->name= name;      mynntp->name= name;
# Line 162  void *create_nntp() { Line 164  void *create_nntp() {
164    return mynntp;    return mynntp;
165    
166  }  }
167    
168    
169    void *create_ssh() {
170      
171      if(myssh == NULL) {
172        static const char *name= "SSH";
173        myssh= NEW(myssh);
174        myssh->name= name;
175        myssh->check= check_ssh;
176      }
177      
178      return myssh;
179    
180    }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26