(** ocaml-exploit

    @author Sang Kil Cha <sangkil.cha\@gmail.com>

*)
(*
    Copyright (c) 2014, Sang Kil Cha
    All rights reserved.
    This software is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License version 2, with the special exception on linking
    described in file LICENSE.

    This software is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*)

type sock

(** establish TCP connection using the given address and port *)
val connect_tcp : string -> int -> sock

(** establish UDP connection using the given address and port *)
val connect_udp : string -> int -> sock

(** disconnect network connection *)
val disconnect : sock -> unit

(** send a message *)
val send_msg : sock -> string -> unit

(** recv message upto maxlen *)
val recv_msg : sock -> int -> string

(** stop and wait for pressing return key *)
val wait : unit -> unit

(** string repetition operator (like python) *)
val ( * ) : string -> int -> string

(** 32bit int to hex *)
val int32_to_hexstring : int32 -> string

(** get a string from a hexstring *)
val hexstring_to_string : string -> string

(** get a hexstring from the given string
    little specifies whether the string is little endian or not *)
val string_to_hexstring : bool -> string -> string

(** simple print, but always flush *)
val print : string -> unit

(** print the given string in a format similar to hexdump *)
val hexdump : string -> unit

(** create a pattern string of length num *)
val pattern_create : int -> string

(** return the position of the given pattern p,
    when the total pattern size is num *)
val pattern_pos : string -> int -> int

