亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gw_stuff.c

?? 手機(jī)短消息服務(wù)的服務(wù)器和客戶端
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*========================================================== * Program : gw_stuff.c                    Project : smslink * Author  : Philippe Andersson. * Date    : 01/03/00 * Version : 0.16b * Notice  : (c) Les Ateliers du Heron, 1998 for Scitex Europe, S.A. * Comment : Library of functions for the smslink sms2mail gateway. * * Modification History : * - 0.01b (19/08/99) : Initial release. Moved the mail gateway- *   specific functions from stuff.c over here. * - 0.02b (28/09/99) : Created mailbox_run(). * - 0.03b (29/09/99) : Extensive rework. Added tkize_ibox_line(), *   reset_mail_struct() and parse_smail(). * - 0.04b (04/10/99) : Added expand_addr(). * - 0.05b (17/10/99) : Expanded parse_smail() extensively. * - 0.06b (19/10/99) : Debugged tkize_ibox_line(). Increased *   debugging output. Created shell for send_mail(). * - 0.07b (20/10/99) : Added mkfromfield(). * - 0.08b (21/10/99) : Added is_dotted_quad () and resolve(). * - 0.09b (08/11/99) : Built dialog in send_mail(). Added *   slurp_n_catch(). * - 0.10b (09/11/99) : Modified parse_smail() to provide a *   default subject field if the SMS doesn't contain one. Involved *   alter the parameters passed to the function. Cosmetics. * - 0.11b (12/11/99) : Improved send_mail() to free() the *   allocated space for the nicified date. * - 0.12b (30/11/99) : Added temp file creation to mailbox_run(). * - 0.13b (24/02/00) : Completed the transfer routine to the *   new mailbox file in mailbox_run(). * - 0.14b (26/02/00) : Made sure the lockfile (MBOX_LOCKF) was *   deleted on each fatal error, as well as on SIGTERM being *   caught (in mailgws_death()). Improved error reporting in *   various functions. Cosmetics. * - 0.15b (29/02/00) : Added functions to handle recepients *   lists (as part of struct email_msg). Heavily modified most *   functions (send_mail(), parse_smail(), expand_addr()) and *   created sub_tkize_field() to account for changes in the *   email_msg struct. * - 0.16b (01/03/00) : Replaced the "old" slurp_n_catch() by *   a new version inspired by get_gsm_answer() (cf. serv_stuff.c). *   This should be more robust and less sensitive to the amount *   of data sent back by the server (here: sendmail). Created *   the clean_field() function (forgotten when split expand_addr() *   from sub_tkize_field()). *========================================================*/#include <unistd.h>#include <stdio.h>                         /* for fprintf */#include <stdlib.h>                  /* for errno & stuff */#include <errno.h>#include <string.h>#include <syslog.h>#include <netdb.h>                 /* for gethostbyname() */#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <sys/time.h>           /* for the struct timeval */#include <sys/types.h>#include <sys/ipc.h>#include <sys/ioctl.h>            /* for the ioctl() call */#ifdef LINUX_LC6#  include <limits.h>                     /* for PATH_MAX */#  include <linux/limits.h>#else#  include <limits.h>#endif#include "sms_serv.h"/*========================================================*//* For debugging purposes only - comment out for normal compile *//* #define INCL_DEBUG_CODE *//*========================================================*/void mailgws_death (){  extern int inbox_is_locked;    /* log it... */  syslog ((FACILITY | LOG_INFO), "gateway exiting on SIGTERM.");    /* remove inbox lock file if necessary */  if (inbox_is_locked) {    unlink (MBOX_LOCKF);  }  /* closes connection to the syslog daemon */  closelog ();    /* now exits gracefully */  exit (0);}                                     /* mailgws_death () *//*========================================================*/void rcpt_list_init (rcpt_list *list){  list->head = NULL;  list->tail = NULL;}                                    /* rcpt_list_init () *//*========================================================*/int empty_rcpt_list (rcpt_list list){  return (list.head == NULL);}                                   /* empty_rcpt_list () *//*========================================================*/void rcpt_list_insert (rcpt_list *list, char *recepient){  /* WARNING : the order of the elements might be relevent - let's   * store them as they were in the header => avoid inserting at   * list head. Do it at the tail. */    int l;  struct rcpt_item *element;  /* alloc memory for new element */  element = (struct rcpt_item *) malloc (sizeof (struct rcpt_item));  if (!element) {    syslog ((FACILITY | LOG_ERR), "can't malloc() for new RCPT entry.");    unlink (MBOX_LOCKF);    syserr ("sms2mailgw: can't malloc() for new RCPT entry");  }    /* initialize fields for new element */  l = strlen (recepient);  element->rcpt = (char *) malloc ((l + 1) * sizeof (char));  if (!element->rcpt) {    syslog ((FACILITY | LOG_ERR), "can't malloc() for new recepient string.");    unlink (MBOX_LOCKF);    syserr ("sms2mailgw: can't malloc() for new recepient string");  }  strcpy (element->rcpt, recepient);    /* chain it in the list */  if (empty_rcpt_list (*list)) {    list->head = element;    list->tail = element;    element->next = NULL;    element->prev = NULL;  }  else {    element->next = NULL;    element->prev = list->tail;    list->tail->next = element;    list->tail = element;  }}                                  /* rcpt_list_insert () *//*========================================================*/void free_rcpt_list (rcpt_list *list){  struct rcpt_item *cursor;  if (!empty_rcpt_list (*list)) {    /* hop to element before last */    cursor = list->tail->prev;    /* now go back and clean behind */    while (cursor != NULL) {      free (cursor->next->rcpt);      free (cursor->next);      cursor->next = NULL;      list->tail = cursor;      cursor = cursor->prev;    }                           /* while (cursor != NULL) */  }                          /* if (!empty_rcpt_list (... */  /* now clean last element and reset header */  free (list->head->rcpt);  free (list->head);  list->head = NULL;  list->tail = NULL;}                                    /* free_rcpt_list () *//*========================================================*/#ifdef INCL_DEBUG_CODEvoid print_rcpt_list (rcpt_list list){  struct rcpt_item *cursor;  if (!empty_rcpt_list (list)) {    cursor = list.head;    fprintf (stderr, "<%s>\n", cursor->rcpt);    while (cursor->next != NULL) {      cursor = cursor->next;      fprintf (stderr, "<%s>\n", cursor->rcpt);    }  }  else {    fprintf (stderr, "sms2mailgw: empty recepient list.\n");  }}                                    /* print_acl_list () */#endif/*========================================================*/int is_dotted_quad (char *string){  int is_dq;  char *s;  int ntok = 0;  char *ptok = NULL;  long int ip_byte;  char **endptr;  char *dummyp;    /*--------------------------------------Initializations */  s = (char *) malloc ((strlen (string) + 1) * sizeof (char));  if (! s) {    syslog ((FACILITY | LOG_ERR), "can't malloc().");    unlink (MBOX_LOCKF);    syserr ("sms2mailgw: can't malloc()");  }  strcpy (s, string);  /*--------------------------------------------Main Loop */  /* no point going any further if the 1st char. is not a digit */  is_dq = isdigit (string[0]);  if (is_dq) {    ptok = strtok (s, ".");    while (ptok != NULL) {      ntok++;#ifdef INCL_DEBUG_CODE      fprintf (stderr, "got token #%d : <%s>\n", ntok, ptok);#endif      dummyp = ptok + strlen (ptok);      endptr = &dummyp;      ip_byte = strtol (ptok, endptr, 10);      if (strlen (*endptr) != 0) {#ifdef INCL_DEBUG_CODE	fprintf (stderr, "error on token #%d : can't convert <%s>\n", ntok, *endptr);#endif	is_dq = FALSE;      }      ptok = strtok (NULL, ".");    }    if (ntok != 4) {      is_dq = FALSE;    }  }                                         /* if (is_dq) */  /*------------------------------------------Conclusions */  free (s);  /*-------------------------------------------------Exit */  return (is_dq);}                                    /* is_dotted_quad () *//*========================================================*/unsigned long int resolve (char *host)/* return the host ip address in network format */{  struct hostent *h_ent;  struct in_addr target_ip;  char **addrs;  char *scratch;    if (is_dotted_quad (host)) {#ifdef INCL_DEBUG_CODE    fprintf (stderr, "I think I got an IP address\n");#endif    if (inet_aton (host, &target_ip) == 0)      syslog ((FACILITY | LOG_ERR), "invalid server IP address (%s).", host);      scratch = (char *) malloc ((MINIBUFF + 1) * sizeof (char));      sprintf (scratch, "sms2mailgw: invalid server IP address (%s)", host);      herror (scratch);      free (scratch);      unlink (MBOX_LOCKF);      exit (1);  }  else {#ifdef INCL_DEBUG_CODE    fprintf (stderr, "I think I got a host name\n");#endif    if ((h_ent = gethostbyname (host)) == NULL) {      syslog ((FACILITY | LOG_ERR), "can't resolve hostname (%s).", host);      scratch = (char *) malloc ((MINIBUFF + 1) * sizeof (char));      sprintf (scratch, "sms2mailgw: can't resolve hostname (%s)", host);      herror (scratch);      free (scratch);      unlink (MBOX_LOCKF);      exit (1);    }    /* lines below cf. "Beginning Linux Progr.", pp. 468-473 */    addrs = h_ent->h_addr_list;    target_ip = *(struct in_addr *)*addrs;#ifdef INCL_DEBUG_CODE    fprintf (stderr, "server IP address is: [%s]\n", inet_ntoa (target_ip));#endif  }                             /* if (isdigit (host[0])) */  return (target_ip.s_addr);}                                           /* resolve () *//*========================================================*/int tkize_ibox_line (char *l, struct inbox_line *tkl){  char *token;  char *scratch;    /*--------------------------------------Initializations */  /* copy input string to scratch space - we can't modify it */  scratch = (char *) malloc ((strlen (l) + 1) * sizeof (char));  if (! scratch) {    syslog ((FACILITY | LOG_ERR), "can't malloc().");    unlink (MBOX_LOCKF);    syserr ("sms2mailgw: can't malloc()");  }  scratch[0] = '\0';  strcpy (scratch, l);    /*--------------------------------------Parsing routine */  /*...............................................Device */  if ((token = strtok (scratch, ",")) == NULL) {    return (-1);  }  strcpy (tkl->device, token);    /*................................................MsgID */  if ((token = strtok (NULL, ",")) == NULL) {    return (-1);  }  tkl->msgid = atoi (token);    /*..............................................FromGSM */  if ((token = strtok (NULL, ",")) == NULL) {    return (-1);  }  strcpy (tkl->fromgsm, token);    /*.................................................Date */  if ((token = strtok (NULL, ",")) == NULL) {    return (-1);  }  strcpy (tkl->date, token);    /*.................................................Time */  if ((token = strtok (NULL, ",")) == NULL) {    return (-1);  }  strcpy (tkl->time, token);    /*.................................................Text */  /* just grab the rest of the line */  if ((token = strtok (NULL, "\0")) == NULL) {    return (-1);  }  /* remove trailing LF */  token[strlen (token) - 1] = '\0';  dequote (token);  strcpy (tkl->text, token);    /*-------------------------------------------------Exit */  free (scratch);  return 0;                                    /* success */}                                   /* tkize_ibox_line () *//*========================================================*/char *expand_addr (char *field, char *defdom){  char *newstring;  /*---------------------------------------Initialization */  newstring = (char *) malloc ((BIGBUFF + 1) * sizeof (char));  if (! newstring) {    syslog ((FACILITY | LOG_ERR), "can't malloc().");    unlink (MBOX_LOCKF);    syserr ("sms2mailgw: can't malloc()");  }  newstring[0] = '\0';    /*---------------------------------Main processing loop */  if (strchr (field, '@') == NULL) {    sprintf (newstring, "%s@%s", field, defdom);  }  else {    strcpy (newstring, field);  }  /*------------------------------------------Conclusions */#ifdef INCL_DEBUG_CODE  fprintf (stderr, "expanded field: [%s]\n", newstring);#endif  return (newstring);}                                       /* expand_addr () *//*========================================================*/char *clean_field (char *field)/* For fields that cannot be multi-part (Reply-to:), remove * the field header and any additional address. */{  char *ptr;    /* The field for sure has a field header - skip it */  shiftleft (field, 2);  /* If the first char now is a space, skip that as well */  if (field[0] == ' ') {    shiftleft (field, 1);  }  /* If the field contains a comma, kill it and all that follows */  if ((ptr = strchr (field, ',')) != NULL) {    ptr[0] = '\0';  }    return (field);}                                       /* clean_field () *//*========================================================*/int sub_tkize_field (rcpt_list *list, char *field, char *defdom){  int nfields = 0;  char *s;  char *ptr;  char *newstring;  char *item;    /*---------------------------------------Initialization */  /* take a local copy of "field" to avoid it being modified */  s = (char *) malloc ((strlen (field) + 1) * sizeof (char));  if (! s) {    syslog ((FACILITY | LOG_ERR), "can't malloc().");    unlink (MBOX_LOCKF);    syserr ("sms2mailgw: can't malloc()");  }  s[0] = '\0';  strcpy (s, field);  ptr = s;    /* s for sure has a field header ("T:" for inst.) - skip it */  ptr += 2;  /* if there was a blank between the header and the field, skip it too */  if (ptr[0] == ' ') {    ptr++;  }    /*---------------------------------Main processing loop */  if ((item = strtok (ptr, ",")) == NULL) {    /* field header w/o contents */    free (s);    return (nfields);  }  /* process first item */  newstring = expand_addr (item, defdom);  rcpt_list_insert (list, newstring);  nfields++;  free (newstring);    /* now tokenize and process the rest */  while ((item = strtok (NULL, ",")) != NULL) {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美国产高清| 亚洲一区二区在线观看视频| 久久精品在这里| 91搞黄在线观看| 九色综合狠狠综合久久| 亚洲福利国产精品| 欧美国产精品一区二区| 91精品在线免费| 欧美在线观看18| av成人免费在线| 国产精品综合av一区二区国产馆| 亚洲一区视频在线| 亚洲欧美日韩人成在线播放| 欧美精品一区二区三区高清aⅴ | 亚洲免费av在线| 久久婷婷国产综合国色天香| 欧美放荡的少妇| 在线观看亚洲精品| 91丨九色丨尤物| 不卡欧美aaaaa| 国产suv精品一区二区883| 毛片一区二区三区| 视频一区在线视频| 亚洲一区二区三区在线播放| 中文字幕一区二区在线观看| 久久你懂得1024| 久久综合久久久久88| 欧美电视剧在线看免费| 在线综合+亚洲+欧美中文字幕| 在线免费亚洲电影| 色香色香欲天天天影视综合网| 成人一区二区三区| 成人毛片视频在线观看| 丁香另类激情小说| 国产91高潮流白浆在线麻豆| 国产剧情一区二区三区| 国产一区在线观看视频| 精品一区二区在线免费观看| 美脚の诱脚舐め脚责91| 美女爽到高潮91| 久久精品国产久精国产| 精品亚洲免费视频| 国产精品18久久久| 成人av免费在线观看| 99在线精品视频| 91麻豆免费视频| 欧美在线你懂的| 欧美三级蜜桃2在线观看| 欧美日韩精品高清| 日韩一区二区三区在线视频| 日韩欧美国产成人一区二区| 精品久久99ma| 国产区在线观看成人精品| 国产精品久久三| 一区二区三区四区亚洲| 亚洲va国产天堂va久久en| 秋霞影院一区二区| 狠狠色综合播放一区二区| 欧美精品一区在线观看| 久久一日本道色综合| 欧美国产日韩亚洲一区| 亚洲三级在线观看| 日韩综合一区二区| 黄一区二区三区| 97久久精品人人澡人人爽| 在线视频欧美区| 欧美一区二区久久久| 久久久午夜电影| 亚洲免费视频中文字幕| 日产国产高清一区二区三区| 国精品**一区二区三区在线蜜桃| 成人福利视频在线| 欧美四级电影在线观看| 精品少妇一区二区三区在线播放 | 亚洲欧洲综合另类| 三级不卡在线观看| 国产盗摄女厕一区二区三区| 在线视频综合导航| 欧美精品一区视频| 一区二区三区视频在线看| 日本亚洲免费观看| av电影在线观看完整版一区二区| 欧美熟乱第一页| 国产农村妇女精品| 丝袜诱惑制服诱惑色一区在线观看| 国产乱国产乱300精品| 91福利精品视频| 26uuu亚洲| 五月天激情综合| 成人国产精品免费网站| 4438x成人网最大色成网站| 国产精品私人自拍| 日本免费在线视频不卡一不卡二 | 成人久久18免费网站麻豆| 5566中文字幕一区二区电影| 国产精品欧美久久久久无广告| 亚洲成人久久影院| 成人av电影在线| 欧美成人性福生活免费看| 亚洲激情图片小说视频| 久久99精品久久久久久| 在线观看一区二区视频| 国产精品美女久久久久av爽李琼 | 亚洲精品国产品国语在线app| 久久99久久99小草精品免视看| 91热门视频在线观看| 久久久亚洲高清| 蜜臀久久99精品久久久久宅男| 国产精品久久精品日日| 美女网站色91| 欧美男男青年gay1069videost| 亚洲欧美日韩国产手机在线| 国产成人免费视频一区| 精品国产乱码久久久久久图片| 午夜欧美视频在线观看| 色婷婷亚洲综合| 国产精品久久久久aaaa樱花 | 五月天丁香久久| 欧美主播一区二区三区| 亚洲天堂2016| 91在线免费播放| 日本一区二区久久| 国产成人精品免费网站| 久久蜜臀精品av| 国产乱码字幕精品高清av| 久久综合久久综合亚洲| 激情六月婷婷久久| 337p日本欧洲亚洲大胆色噜噜| 老司机免费视频一区二区 | 综合网在线视频| 波多野结衣亚洲一区| 中文字幕精品三区| 懂色av噜噜一区二区三区av| 欧美经典一区二区| 成人动漫一区二区| 国产精品不卡在线| 99久久久国产精品免费蜜臀| 综合色中文字幕| 国产精品免费aⅴ片在线观看| 成人av综合在线| 亚洲三级免费观看| 91国偷自产一区二区开放时间| 亚洲欧美另类久久久精品2019| 99国产欧美另类久久久精品| 一区二区三区小说| 911精品国产一区二区在线| 午夜伦欧美伦电影理论片| 日韩一二在线观看| 国产一区二区三区在线看麻豆| 久久久久久久久久美女| 不卡一区二区三区四区| 一区二区三区欧美在线观看| 欧美色视频一区| 奇米777欧美一区二区| 久久综合久久综合久久| 成人精品亚洲人成在线| 一区二区三区不卡在线观看| 7777精品伊人久久久大香线蕉超级流畅 | 日本中文在线一区| 欧美精品一区男女天堂| www.激情成人| 亚洲超碰精品一区二区| 欧美videofree性高清杂交| 国产精品一区专区| 一区二区三区在线观看欧美| 欧美精品三级日韩久久| 国产麻豆日韩欧美久久| 亚洲精品久久嫩草网站秘色| 欧美顶级少妇做爰| 精品在线一区二区三区| 亚洲欧洲日韩一区二区三区| 欧美视频日韩视频| 国产高清亚洲一区| 亚洲成人av福利| 久久久午夜精品理论片中文字幕| 色av一区二区| 久久99精品久久久久久国产越南| 中文字幕一区二区三区精华液 | 日韩视频一区在线观看| 国产99精品在线观看| 亚洲电影在线免费观看| 精品电影一区二区| 91黄色免费版| 黄页视频在线91| 亚洲国产精品影院| 日本一区二区三区电影| 91精品蜜臀在线一区尤物| av影院午夜一区| 免费亚洲电影在线| 亚洲精选免费视频| 久久久国产综合精品女国产盗摄| 在线一区二区三区四区| 国内不卡的二区三区中文字幕| 亚洲一本大道在线| 国产精品免费观看视频| 日韩精品在线网站| 欧美日韩一区二区三区不卡 | 欧美三级中文字幕在线观看| 国产+成+人+亚洲欧洲自线| 免费精品视频在线|