Changeset 920 for pjproject


Ignore:
Timestamp:
Feb 1, 2007 12:33:12 AM (18 years ago)
Author:
bennylp
Message:

Implement ticket #83: socket TOS abstraction

Location:
pjproject/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure.ac

    r909 r920  
    128128AC_CHECK_HEADER(netdb.h,[AC_DEFINE(PJ_HAS_NETDB_H,1)]) 
    129129AC_CHECK_HEADER(netinet/in.h,[AC_DEFINE(PJ_HAS_NETINET_IN_H,1)]) 
     130AC_CHECK_HEADER(netinet/ip.h,[AC_DEFINE(PJ_HAS_NETINET_IP_H,1)]) 
    130131AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)]) 
    131132AC_CHECK_HEADER(stdarg.h,[AC_DEFINE(PJ_HAS_STDARG_H,1)]) 
  • pjproject/trunk/pjlib/include/pj/compat/os_auto.h.in

    r700 r920  
    5151#undef PJ_HAS_NETDB_H 
    5252#undef PJ_HAS_NETINET_IN_H 
     53#undef PJ_HAS_NETINET_IP_H 
    5354#undef PJ_HAS_SETJMP_H 
    5455#undef PJ_HAS_STDARG_H 
  • pjproject/trunk/pjlib/include/pj/compat/socket.h

    r699 r920  
    5151#if defined(PJ_HAS_NETINET_IN_H) && PJ_HAS_NETINET_IN_H != 0 
    5252#  include <netinet/in.h> 
     53#endif 
     54 
     55#if defined(PJ_HAS_NETINET_IP_H) && PJ_HAS_NETINET_IP_H != 0 
     56/* To pull in IPTOS_* constants */ 
     57#  include <netinet/ip.h> 
    5358#endif 
    5459 
  • pjproject/trunk/pjlib/include/pj/sock.h

    r860 r920  
    9393extern const pj_uint16_t PJ_SOL_UDP;    /**< UDP level.     */ 
    9494extern const pj_uint16_t PJ_SOL_IPV6;   /**< IP version 6   */ 
     95 
     96 
     97/* IP_TOS  
     98 * 
     99 * Note: 
     100 *  TOS CURRENTLY DOES NOT WORK IN Windows 2000 and above! 
     101 *  See http://support.microsoft.com/kb/248611 
     102 */ 
     103extern const pj_uint16_t PJ_IP_TOS;     /**< IP_TOS optname in setsockopt() */ 
     104 
     105 
     106/* 
     107 * IP TOS related constats. 
     108 * 
     109 * Note: 
     110 *  TOS CURRENTLY DOES NOT WORK IN Windows 2000 and above! 
     111 *  See http://support.microsoft.com/kb/248611 
     112 */ 
     113extern const pj_uint16_t PJ_IPTOS_LOWDELAY;     /**< Minimize  delays       */ 
     114extern const pj_uint16_t PJ_IPTOS_THROUGHPUT;   /**< Optimize throughput    */ 
     115extern const pj_uint16_t PJ_IPTOS_RELIABILITY;  /**< Optimize for reliability*/ 
     116extern const pj_uint16_t PJ_IPTOS_MINCOST;      /**< "filler data" where slow  
     117                                                 transmission does't matter */ 
     118 
    95119 
    96120/** 
  • pjproject/trunk/pjlib/src/pj/sock_bsd.c

    r860 r920  
    4747 * The values here are indexed based on pj_sock_type 
    4848 */ 
    49 const pj_uint16_t PJ_SOCK_STREAM        = SOCK_STREAM; 
     49const pj_uint16_t PJ_SOCK_STREAM= SOCK_STREAM; 
    5050const pj_uint16_t PJ_SOCK_DGRAM = SOCK_DGRAM; 
    5151const pj_uint16_t PJ_SOCK_RAW   = SOCK_RAW; 
     
    7777#endif 
    7878 
     79/* IP_TOS */ 
     80#ifdef IP_TOS 
     81const pj_uint16_t PJ_IP_TOS     = IP_TOS; 
     82#else 
     83const pj_uint16_t PJ_IP_TOS     = 1; 
     84#endif 
     85 
     86 
     87/* TOS settings (declared in netinet/ip.h) */ 
     88#ifdef IPTOS_LOWDELAY 
     89const pj_uint16_t PJ_IPTOS_LOWDELAY     = IPTOS_LOWDELAY; 
     90#else 
     91const pj_uint16_t PJ_IPTOS_LOWDELAY     = 0x10; 
     92#endif 
     93#ifdef IPTOS_THROUGHPUT 
     94const pj_uint16_t PJ_IPTOS_THROUGHPUT   = IPTOS_THROUGHPUT; 
     95#else 
     96const pj_uint16_t PJ_IPTOS_THROUGHPUT   = 0x08; 
     97#endif 
     98#ifdef IPTOS_RELIABILITY 
     99const pj_uint16_t PJ_IPTOS_RELIABILITY  = IPTOS_RELIABILITY; 
     100#else 
     101const pj_uint16_t PJ_IPTOS_RELIABILITY  = 0x04; 
     102#endif 
     103#ifdef IPTOS_MINCOST 
     104const pj_uint16_t PJ_IPTOS_MINCOST      = IPTOS_MINCOST; 
     105#else 
     106const pj_uint16_t PJ_IPTOS_MINCOST      = 0x02; 
     107#endif 
     108 
     109 
    79110/* optname values. */ 
    80111const pj_uint16_t PJ_SO_TYPE    = SO_TYPE; 
Note: See TracChangeset for help on using the changeset viewer.