/[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.12 by chopp, Wed Aug 13 22:18:43 2003 UTC revision 1.13 by hauk, Fri Aug 29 16:58:07 2003 UTC
# Line 46  static Protocol_T mydwp= NULL; Line 46  static Protocol_T mydwp= NULL;
46  static Protocol_T myldap2= NULL;  static Protocol_T myldap2= NULL;
47  static Protocol_T myldap3= NULL;  static Protocol_T myldap3= NULL;
48  static Protocol_T myrdate= NULL;  static Protocol_T myrdate= NULL;
49    static Protocol_T myrsync= NULL;
50    
51    
52  /**  /**
# Line 76  void gc_protocols() { Line 77  void gc_protocols() {
77    free(mydwp);     mydwp= NULL;    free(mydwp);     mydwp= NULL;
78    free(myldap2);   myldap2= NULL;    free(myldap2);   myldap2= NULL;
79    free(myldap3);   myldap3= NULL;    free(myldap3);   myldap3= NULL;
80      free(myrdate);   myrdate= NULL;
81      free(myrsync);   myrsync= NULL;
82    
83  }  }
84    
# Line 83  void gc_protocols() { Line 86  void gc_protocols() {
86  void *create_default() {  void *create_default() {
87    
88    if(mydefault == NULL) {    if(mydefault == NULL) {
     static const char *name= "DEFAULT";  
89      NEW(mydefault);      NEW(mydefault);
90      mydefault->name= name;      mydefault->name= "DEFAULT";
91      mydefault->check= check_default;      mydefault->check= check_default;
92    }    }
93    
# Line 97  void *create_default() { Line 99  void *create_default() {
99  void *create_http() {  void *create_http() {
100    
101    if(myhttp == NULL) {    if(myhttp == NULL) {
     static const char *name= "HTTP";  
102      NEW(myhttp);      NEW(myhttp);
103      myhttp->name= name;      myhttp->name= "HTTP";
104      myhttp->check= check_http;      myhttp->check= check_http;
105    }    }
106    
# Line 111  void *create_http() { Line 112  void *create_http() {
112  void *create_ftp() {  void *create_ftp() {
113    
114    if(myftp == NULL) {    if(myftp == NULL) {
     static const char *name= "FTP";  
115      NEW(myftp);      NEW(myftp);
116      myftp->name= name;      myftp->name= "FTP";
117      myftp->check= check_ftp;      myftp->check= check_ftp;
118    }    }
119    
# Line 125  void *create_ftp() { Line 125  void *create_ftp() {
125  void *create_smtp() {  void *create_smtp() {
126    
127    if(mysmtp == NULL) {    if(mysmtp == NULL) {
     static const char *name= "SMTP";  
128      NEW(mysmtp);      NEW(mysmtp);
129      mysmtp->name= name;      mysmtp->name= "SMTP";
130      mysmtp->check= check_smtp;      mysmtp->check= check_smtp;
131    }    }
132    
# Line 139  void *create_smtp() { Line 138  void *create_smtp() {
138  void *create_pop() {  void *create_pop() {
139    
140    if(mypop == NULL) {    if(mypop == NULL) {
     static const char *name= "POP";  
141      NEW(mypop);      NEW(mypop);
142      mypop->name= name;      mypop->name= "POP";
143      mypop->check= check_pop;      mypop->check= check_pop;
144    }    }
145    
# Line 153  void *create_pop() { Line 151  void *create_pop() {
151  void *create_imap() {  void *create_imap() {
152    
153    if(myimap == NULL) {    if(myimap == NULL) {
     static const char *name= "IMAP";  
154      NEW(myimap);      NEW(myimap);
155      myimap->name= name;      myimap->name= "IMAP";
156      myimap->check= check_imap;      myimap->check= check_imap;
157    }    }
158    
# Line 167  void *create_imap() { Line 164  void *create_imap() {
164  void *create_nntp() {  void *create_nntp() {
165    
166    if(mynntp == NULL) {    if(mynntp == NULL) {
     static const char *name= "NNTP";  
167      NEW(mynntp);      NEW(mynntp);
168      mynntp->name= name;      mynntp->name= "NNTP";
169      mynntp->check= check_nntp;      mynntp->check= check_nntp;
170    }    }
171    
# Line 181  void *create_nntp() { Line 177  void *create_nntp() {
177  void *create_ssh() {  void *create_ssh() {
178        
179    if(myssh == NULL) {    if(myssh == NULL) {
     static const char *name= "SSH";  
180      NEW(myssh);      NEW(myssh);
181      myssh->name= name;      myssh->name= "SSH";
182      myssh->check= check_ssh;      myssh->check= check_ssh;
183    }    }
184        
# Line 195  void *create_ssh() { Line 190  void *create_ssh() {
190  void *create_dwp() {  void *create_dwp() {
191        
192    if(mydwp == NULL) {    if(mydwp == NULL) {
     static const char *name= "DWP";  
193      NEW(mydwp);      NEW(mydwp);
194      mydwp->name= name;      mydwp->name= "DWP";
195      mydwp->check= check_dwp;      mydwp->check= check_dwp;
196    }    }
197        
# Line 209  void *create_dwp() { Line 203  void *create_dwp() {
203  void *create_ldap2() {  void *create_ldap2() {
204        
205    if(myldap2 == NULL) {    if(myldap2 == NULL) {
     static const char *name= "LDAP2";  
206      NEW(myldap2);      NEW(myldap2);
207      myldap2->name= name;      myldap2->name= "LDAP2";
208      myldap2->check= check_ldap2;      myldap2->check= check_ldap2;
209    }    }
210        
# Line 223  void *create_ldap2() { Line 216  void *create_ldap2() {
216  void *create_ldap3() {  void *create_ldap3() {
217        
218    if(myldap3 == NULL) {    if(myldap3 == NULL) {
     static const char *name= "LDAP3";  
219      NEW(myldap3);      NEW(myldap3);
220      myldap3->name= name;      myldap3->name= "LDAP3";
221      myldap3->check= check_ldap3;      myldap3->check= check_ldap3;
222    }    }
223        
# Line 236  void *create_ldap3() { Line 228  void *create_ldap3() {
228  void *create_rdate() {  void *create_rdate() {
229        
230    if(myrdate == NULL) {    if(myrdate == NULL) {
     static const char *name= "RDATE";  
231      NEW(myrdate);      NEW(myrdate);
232      myrdate->name= name;      myrdate->name= "RDATE";
233      myrdate->check= check_rdate;      myrdate->check= check_rdate;
234    }    }
235        
236    return myrdate;    return myrdate;
237      
238    }
239    
240    void *create_rsync() {
241      
242      if(myrsync == NULL) {
243        NEW(myrsync);
244        myrsync->name= "RSYNC";
245        myrsync->check= check_rsync;
246      }
247      
248      return myrsync;
249      
250  }  }
251    
252    

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

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