HTTP/XML API

Started by scooper

scooper

HTTP/XML API   13 May 2006, 16:01

Can anyone help me find the documentation for the "simple protocol based on HTTP and XML" API mentioned in the FAQ?

Thanks in Advance.
SoftPerfect Support forum - Andrew avatar image

Re: HTTP/XML API   13 May 2006, 21:27

Unfortunately there is no ready to use manual on this protocol yet, but if you have a specific question (e.g. how can I add a rule, or how to retrieve stats), I would be glad to help you.

Re: HTTP/XML API   14 May 2006, 20:07

Thanks Andrew,

Does the management UI use HTTP/XML? (havent bothered to look because I dont have a sniffer installed ;o) If it does I guess I could just do with a basic overview and I can reverse the rest.

Hoping to create a simple CGI (probably perl or php) so non-technical users can add/remove nodes. In my case two template based rules are needed per node. So what im after I guess is really just add/delete a rule and retrieve stats (daily report) for reporting purposes. A nice to have would be add/delete mac/ip groups but this isnt so important.

I will be happy to share the end result with the forum if anyone else is interested (BTW if someone else has done this already pls speak up..)

Cheers,
Scooper

Re: HTTP/XML API   14 May 2006, 20:36

Ok so I installed ethereal... I see the schema is the same as the "save ruleset" output. Dont think I will need any help, but I will shout out if I do.
Ugh, for some reason I assumed this was XML-RPC. Is this protocol based on some standard?

Thanks again,
Scooper
SoftPerfect Support forum - Andrew avatar image

Re: HTTP/XML API   14 May 2006, 22:06

No, it is based on pure XML transferred via the HTTP protocol. However, as you can see it can be quite easily understood.
I would also recommend to have a look at this example

Re: HTTP/XML API   14 May 2006, 23:45

OK thanks for that. You wouldnt happen to have the DTDs and/or a table of the enumerations (i.e "protocol=", "ip-* type="wink handy by any chance?
SoftPerfect Support forum - Andrew avatar image

Re: HTTP/XML API   15 May 2006, 01:35

Sorry, there is no DTD. Some enumerations are:
Protocols
 RULE_PROTO_ANY     = 0;
 RULE_PROTO_TCP     = 1;
 RULE_PROTO_UDP     = 2;
 RULE_PROTO_TCPUDP  = 3;
 RULE_PROTO_AHESP   = 4;
 RULE_PROTO_GRE     = 5;
 RULE_PROTO_ICMP    = 6;
 RULE_PROTO_ANYIP   = 7;

Source & Destination Address
 RULE_IPTYPE_LOCALHOST  = 0;
 RULE_IPTYPE_SINGLEADDR = 1;
 RULE_IPTYPE_WHOLERANGE = 2;
 RULE_IPTYPE_ANYADDRESS = 3;
 RULE_IPTYPE_MACADDRESS = 4;
 RULE_IPTYPE_ADDRGROUP  = 5;

Source & Destination Port
 RULE_IPSVCTYPE_ANYPORT = 0;
 RULE_IPSVCTYPE_PSINGLE = 1;
 RULE_IPSVCTYPE_PRANGE  = 2;
 RULE_IPSVCTYPE_PLIST   = 3;
If you find something, that you don't understand, please don't hesitate to ask.

Re: HTTP/XML API   18 May 2006, 20:40

Thanks for that Andrew.

Just a query on IDs; I gather that ID generation in the responsability of the client?

(ps. I dont need to tell you that this is a bad idea ;o)
SoftPerfect Support forum - Andrew avatar image

Re: HTTP/XML API   18 May 2006, 20:59

Yes, IDs are generated by the GUI. This works excellently as long as the client stable, to avoid desynchronization between IDs. The IDs are generated as "unsigned int" from GetTickCount API call. However, you can use any other unique integer values in the range 1 to 2^31-1.

Sometimes you can get the answer faster if you try the forum search and/or have a look at the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **    **  ********   **      **  ********  ********  
  **  **   **     **  **  **  **  **        **     ** 
   ****    **     **  **  **  **  **        **     ** 
    **     ********   **  **  **  ******    **     ** 
    **     **     **  **  **  **  **        **     ** 
    **     **     **  **  **  **  **        **     ** 
    **     ********    ***  ***   ********  ********  

Message: